node.js - 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);
解决方案
const test= http.createServer((re,res)=>{} console.log(test,"hi from server)
推荐阅读
- scala - 如何在合并中替换空值并添加
- javascript - jquery 检查父元素中是否有特定的文本,如果有,则在特定的预先存在的子元素之后添加子元素
- vb.net - VB.NET 在图片框中绘制与设备无关的位图
- python - 如何处理依赖的多个主要版本
- javascript - 交换两个 ngx-select 的值
- c - S32K146EVB 擦除/写入闪存时发生读取冲突
- json - 如何在pyspark中将rdd转换为嵌套的json
- php - 大型 php 站点地图(使用数据库连接)可以减慢/阻塞服务器吗?
- excel - 将 Excel 电子表格数据导入另一个 Excel 电子表格 - 然后移至下一行
- gekko - 使用“过去”值定义 GEKKO 方程中的当前值