see my?blog.
用nodejs现成的express module,几行代码就能写个server出来:
class="hljs javascript">monospace; font-size: 12px; color: inherit; background-color: transparent; border-radius: 0px; padding: 0px; border: none; vertical-align: middle;" class="javascript">
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">function () {
console.log('Listening on port, process.cwd(): ' + process.cwd() );
});
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
?