文件操作 - params.js
返回文件管理
返回主菜单
删除本文件
文件: /root/node_modules/express-ws/examples/params.js
编辑文件内容
var express = require('express'); var expressWs = require('..'); var expressWs = expressWs(express()); var app = expressWs.app; app.param('world', function (req, res, next, world) { req.world = world || 'world'; return next(); }); app.get('/hello/:world', function(req, res, next){ console.log('hello', req.world); res.end(); next(); }); app.ws('/hello/:world', function(ws, req, next) { ws.on('message', function(msg) { console.log(msg); }); console.log('socket hello', req.world); next(); }); app.listen(3000)
修改文件时间
将文件时间修改为当前时间的前一年
删除文件