![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nodejs
小乒和小乓呀
这个作者很懒,什么都没留下…
展开
-
nodejs中利用http创建服务
Node.js 创建的第一个应用 1、引入 http 模块 var http = require("http"); 2、创建服务器 接下来我们使用 http.createServer() 方法创建服务器,并使用 listen 方法绑定 3000 端口。 函数通过 request, response 参数来接收和响应数据。 const http = require('http'); http.createServer((req, res) => {原创 2021-03-01 19:01:43 · 211 阅读 · 0 评论 -
Node.js中fs的使用
fs的使用 1. fs.stat 检测是文件还是目录 const fs = require('fs') fs.stat('hello.js', (error, stats) => { if (error) { console.log(error) } else { console.log(stats) console.log(`文件原创 2021-03-01 18:55:31 · 176 阅读 · 0 评论