Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

beidou-plugin-router

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beidou-plugin-router

beidou auto router

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Table of Contents generated with DocToc

Beidou Router

Auto Router for Beidou framework

Install

$ npm install beidou-plugin-router --save

Configuration

  • config/plugin.default.js:
exports.router = {
  enable: true,
  package: 'beidou-plugin-router',
};
  • config/config.default.js
  /**
   * View options
   * @member Config#view
   */
  exports.router = {
    /**
     * root directory for auto match route
     * include server route and webpack entry
     * @member {String} Config#root
     * @since 1.0.0
     */
    root: '/',

    /**
     * files or directories should be ingored
     * when automatically match route
     * @member {String} Config#exclude
     * @since 1.0.0
     */
    exclude: '_*',

    /**
     * define custom mapping files to router
     *
     * {
     *  user: {
     *    profile: 'get',
     *    ':id': ['post', 'get'],
     *    
     *  }
     * }
     * 
     */
    mapping: null,

    entry: 'index',
  };

Usage

Straightly visit page located in client directory.

e.g. with default config, access GET: / will render client/index.jsx file.

API

coming soon

License

MIT

FAQs

Package last updated on 15 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc