express框架构架的nodejs企业网站,请问如何控制路由?
.get(function(req, res) {});.put(function(req, res) {});.post(function(req, res) {});.delete(function(req, res) {});
有没有方法总结起来的?有什么好的模块推荐吗?管理我的路由?如果没有,可否提供一个比较合适的思路? 谢谢了
人生最曼妙的风景,竟是内心的淡定与从容!
You can write all callback functions to the router-action directory, and then call them through routerAction.functionName
var express = require('express'), router = express.Router(), routerAction = require('../router-action'); router.get('/', routerAction.index);
You can write all callback functions to the router-action directory, and then call them through routerAction.functionName