Question: I'm setting up a new server in Node.js, and the terminal keeps on saying Reference Error: server is not defined. Is there another way to setup a server? Or is there a syntax error?

```
const http = require('http');

http.createServer((req, res) => {
    console.log(req)
});

server.listen(3000);

```

Answer: 
you may try this way also.

```
const http = require('http');

http.createServer((req, res) => {
    console.log(req)
}).listen(3000);

```
You just need to declare a variable to hold the server value

```
const http = require('http');

const server = http.createServer((req, res) => {
    console.log(req)
});

server.listen(3000);

```