Node how to start page – What’s the simplest way to create a basic page in Node.js? Alternatively: Nod

18 Replies, 1120 Views

Yo! If you want the *fastest* way, here’s a one-liner with `http`:

```javascript
require('http').createServer((req, res) => res.end('Hey, it works!')).listen(3000);
```

Boom. Done.

But if you plan to build more, Express is way cleaner. For now, though, this’ll get you rolling.

Messages In This Thread



Users browsing this thread: 1 Guest(s)