测试
全部博文(931)
分类: 架构设计与优化
2019-04-25 15:38:55
see my blog.
用nodejs现成的express module,几行代码就能写个server出来:
var express = require('express'); var routesEngine = require('./jerryapp/routes/index.js'); // index.js actually http://www.ruanyifeng.com/blog/2015/05/require.html var app = express();
app.use('/ui5', express.static(process.cwd() + '/webapp'));
app.use('/v', express.static(process.cwd() + '/vue'));
app.use('/map', express.static(process.cwd() + '/map'));
app.use('/tile', express.static(process.cwd() + '/tileStudy'));
app.use('/a2', express.static(process.cwd() + '/a2'));
routesEngine(app);
app.listen(process.env.PORT || 3000, function () { console.log('Listening on port, process.cwd(): ' + process.cwd() );
});
要获取更多Jerry的原创文章,请关注公众号"汪子熙":