Skip to content

add DSL for configuring routes #25

@MiguelCastillo

Description

@MiguelCastillo

Adding the ability to configure routes and mapping them to modules that handle them would be fantastic. Example:

{
  "routes": {
    "/hello/world": "./helloWorldController",
    "/hello/next": (req, res, next) => { next() },
    "/hello/promise": (req, res) => { return Promise.resolve(); }
  }
}

The example above will load ./helloWorldController, which is expected to be a function, and will be configured as the route handle for /hello/world. You can alternatively map the route to an actual function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions