首页 > 解决方案 > Node server is not starting(command executes but not start the port)?

问题描述

when I enter "node server.js" then execution start and the cursor stuck at the starting of the next line what is the error.

const http = require('http');
http.createServer((req, res) => {
    console.log("hi from server");
    res.end('ok');
}).listen(8000);

Image

标签: node.jsnodejs-server

解决方案


const test= http.createServer((re,res)=>{} console.log(test,"hi from server)


推荐阅读