javascript - 创建本地主机服务器时如何克服此错误?
问题描述
这是我在此代码中输入的代码,并且在浏览器中显示错误
const http = require('http');
const server = http.createServer((req , res) =>{
res.end('Hello fromm the server!');
});
server.listen(8000, '127.0.0.1', () => {
console.log('Listening to request on port 8000');
})
解决方案
推荐阅读
- html - HTML 电子邮件:Outlook 中的粗体字重不起作用
- office365-apps - Office 365 文档查看器 - 不适用于具有端口号的 URL
- python - 我可以编写在执行期间修改自身的python代码吗?
- admob - AdMob 移动广告 - 潜在广告客户不成熟
- python - 当 dtype 是(显然)无论如何都会选择的内容时,为什么设置 Series dtype 会引发 TypeError?
- angular - NG6:图书馆提供的服务未定义
- macos - XML 和 INI 文件无法在 Mac 上直接打开
- javascript - 在比较期间通过通配符或正则表达式省略多个键
- sql - 在 web 应用程序中保存图像文件,java
- bash - makefile 中的 Bash 通配符不起作用