@vacantthinker/util_express_js
v1.0.10
Published
util express js
Downloads
1
Readme
how to use ?
dir
express-project/
server/
router/
notice.router.js
open.router.js
util.express.js <=== (generator by xxx.js geneUtilExpressJs() )
app.js (const app = express() )
xxx.js <=== (node xxx.js)
in xxx.js
const {geneUtilExpressJs} = require('@vacantthinker/util_express_js');
geneUtilExpressJs()
generator util.express.js
node xxx.js
util.express.js
'use strict';
function setupRouterList(app, passdata) {
const noticeRouter = require('./router/notice.router.js');
const openRouter = require('./router/open.router.js');
app.use('/notice', noticeRouter(passdata));
app.use('/open', openRouter(passdata));
}
module.exports = {
setupRouterList: setupRouterList
}
in your app.js (express)
require('./util.express').setupRouterList(app, passdata);
app.listen(3000, async () => {
console.log(`running 3000`);
});
how to install ?
npm install @vacantthinker/util_express_js -D