JSPM

coalcodes-route-builder

0.0.0-beta.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 10
    • Score
      100M100P100Q36459F
    • License ISC

    A library to create routes based on comments (like symfony) or configurations (like yaml, json, etc)

    Package Exports

    • coalcodes-route-builder
    • coalcodes-route-builder/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coalcodes-route-builder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    CoalCodes Route Builder

    A tool to make easier the creation of routes inside most frameworks.
    Simple to use and customizable

    Installation

    Install this package using NPM.

    As a good practice it is recommended to install as development dependency because this module create all files necessary for the routing, you can bring these files to production.

    npm install --save-dev coalcodes-route-builder

    Usage

    import builder from 'coalcodes-route-builder';
    builder(`path/to/controllers`, `path/to/routes`);

    Builder Class

    import {Builder} from 'coalcodes-route-builder';
    
    let apiV1 = new Builder(`api/v1/controllers`, `api/v1/routes`);
    apiV1.build();
    
    let apiV2 = new Builder(`api/v2/controllers`, `api/v2/routes`);
    apiV2.build();

    Route Class

    import {Route} from 'coalcodes-route-builder';
    
    let customRoute = new Route(`api/v1/controllers`, `api/v1/routes`);