Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DSL for configuring routes #25

Open
MiguelCastillo opened this issue Sep 15, 2017 · 0 comments
Open

add DSL for configuring routes #25

MiguelCastillo opened this issue Sep 15, 2017 · 0 comments

Comments

@MiguelCastillo
Copy link
Owner

MiguelCastillo commented Sep 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant