摘要: 模块化重点记住一下这句话: 使用require模块时得到的永远是module.exports的对象 模块化代码如下: // module.exports 相当于一个共享方法 module.exports.username = 'zs'; module.exports.nihao = () => { 阅读全文
posted @ 2020-08-22 19:13 彬戈戎马 阅读(118) 评论(0) 推荐(1) 编辑
摘要: 创建index.js 文件里面的内容为: // index.js文件 // 包的入口文件 const date = require('./src/dataFormat') const escape = require('./src/htmlEscape') // 向外暴露需要的成员 module.e 阅读全文
posted @ 2020-08-22 19:02 彬戈戎马 阅读(136) 评论(0) 推荐(1) 编辑
摘要: const express = require('express') const app = express() // 定义一个中间件函数 // const mw = (req, res, next) => { // console.log('最简单的中间件函数') // 把流转的关系转交给下一个中 阅读全文
posted @ 2020-08-22 18:47 彬戈戎马 阅读(142) 评论(0) 推荐(1) 编辑