think-router

1.3.5 • Public • Published

think-router

Build Status Coverage Status npm

Router for ThinkJS 3.x

Install

npm install think-router

How to use

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
}

Router config

config file src/config/router.js

module.exports = [
  ['/index', '/list']
]

Readme

Keywords

none

Package Sidebar

Install

npm i think-router

Weekly Downloads

771

Version

1.3.5

License

none

Unpacked Size

46 kB

Total Files

8

Last publish

Collaborators

  • lizheming
  • welefen
  • sijiecai
  • lushijie
  • berwin
  • bezos
  • toxicjohann
  • huangxiaolu