Router for ThinkJS 3.x
npm install think-router
config file src/config/middleware.js
const router = require('think-router');
module.exports = [
{handle: router, options: {}}
];
support options:
{
defaultModule: 'home', //default module name, is enable in multi module mode
defaultController: 'index', //default controller name
defaultAction: 'index', //default action name
prefix: [], // url prefix
suffix: ['.html'], // url suffix
enableDefaultRouter: true,
optimizeHomepageRouter: true,
subdomainOffset: 2,
subdomain: {}, //subdomain
denyModules: [] //deny module, enable in multi module mode
}
config file src/config/router.js
module.exports = [
['/index', '/list']
]