摘要:
req.fresh req.stale var version = 100; app.get('/test',function(req,res){ res.set('etag',version); if(req.fresh){ res.send(); }else{ res.send('version 阅读全文
摘要:
req.method -->GET req.hostname -->127.0.0.1 req.originalUrl -->/test/test/test?name=wang req.protocol -->http req.path -->/test/test/test req.params - 阅读全文
摘要:
const express= require('express'); const app = express(); app.use('/public',express.static(__dirname+'public')); 第一个参数:访问路径 ,第二个参数:静态资源路径 app.use('/pu 阅读全文
摘要:
/abc?d 表示c可有可无 /abc+d c至少出现一次或者多次,末尾必须有d /abc\*d c和d之间可以有任意多个字符,但是末尾必须有d /a(bc)?d bc可有可无 /a(bc)+d bc至少出现一次或者多次,末尾必须有d /\/ab[1,2]cd/ 正则匹配 ['abc?d','abc 阅读全文