![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Node.js
爱敲代码的啊辉
这个作者很懒,什么都没留下…
展开
-
Node.js之express.Router
可使用 express.Router 类创建模块化、可挂载的路由句柄。在 app 目录下创建名为 birds.js 的文件,内容如下:var express = require('express');var router = express.Router();// 该路由使用的中间件router.use(function timeLog(req, res, next) { console.log('Time: ', Date.now()); next();});// 定义网站主页的路原创 2021-10-17 11:08:18 · 332 阅读 · 0 评论 -
Node.js常用内置模块
1、url1.1 parseurl.parse(urlString[, parseQueryString[, slashesDenoteHost]])url.parse()可以将一个完整的URL地址,分为很多部分,常用的有:host、port、pathname、path、query。第二个参数为 true 表示直接将查询字符串转为一个对象(通过query属性来访问),默认第二个参数为false。const url = require('url')const urlString = 'https:原创 2021-10-17 10:56:04 · 88 阅读 · 0 评论