See project PorYoung/allChat, an online chat web application based on egg.js and sockt.io. Egg + Webpack + Socket.io Notes Directory Structure - app - controller - extend - middleware - model - service - public - dist /* webpack output directory */ - io /* socket.io */ - controller - middleware - view - router.js - config - config.default.js - plugin.js - build /* webpack */ - src - webpack.config.js - ... Egg Quick Usage npm i egg-init -g egg-init egg-example --type=simple cd egg-example npm i npm run dev The server listens on 7001. See egg for more detail. Config config/config.default.js default content 'use strict'; const path = require('path'); module.exports = appInfo => { const config = exports = {}; // use for cookie sign key, should change to your own and keep security config.keys = appInfo.name + 'your_keys'; // add your config here return config; } middleware // add your middleware config.middleware = ['permission','middleware2']; // your middleware config, which will be the param 'options' you can access later config.permission = { excludeUrl: { 'ALL':…
Tag: mongoose
1 Posts