app.js 639 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. var express = require('express');
  2. var app = express();
  3. var router = express.Router();
  4. //引入工具类
  5. var logHelper = require("./helper/LjLogHelper.js");
  6. //根据不同的功能划分模块
  7. app.use('/lesson', require('./router/lesson'))
  8. app.get('/', function (req, res) {
  9. //res.render('index.html');
  10. console.info(__dirname+'/index.html');
  11. res.sendFile(__dirname+'/index.html',
  12. {
  13. "image":"222"
  14. });
  15. })
  16. //启动监听
  17. app.listen(9191, function ()
  18. {
  19. logHelper.info("winBoxNode starting success");
  20. });
  21. process.on('uncaughtException', function (err)
  22. {
  23. logHelper.error(err);
  24. });