dwyl / dwyl/abase

Using an object to specify routes instead of JSON

Open
#68 0 comments 1 reaction 0 assignees View on GitHub
enhancement question
Dominant language
JavaScript
Stars
9
Forks
0
PR merge metrics
No merged PRs in 30d

Description

(h/t @des-des)

Might be nice to specify the standard routes (e.g `login`, `signup`, etc) with a handler object instead of in the JSON configuration file.

Fora usage example:

``` javascript
server.route({
method: 'GET',
path: '/login',
handler: {
form: {
email: { label: 'E-mail: ' },
password: { label: 'Password', confirm: true }
}
}
});
```

This can be implemented using the [`server.handler`](http://hapijs.com/api#serverhandlername-method) method.

This can then be specified inside the plugin instead of being part of the JSON, meaning we impose certain routes (which is fine; the user has required abase because they want a user system, right?), and the user has less JSON to worry about.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.