Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
hapi-route-manager
Advanced tools
(Under Development) Yet another route manager for versioned HAPI REST APIs
We really wanted a better way to manage both route versions and the routes themselves in larger deployments of Hapi apps
server.register({
register: require('hapi-route-manager'),
options: {
directory: "./routes",
}
})
Within the ./routes
directory we have a structure of:
routes/
├── v1/
│ └── user/
| ├── index.route.js
| ├── {urlParam}.route.js
| └── stuff.route.js
│
├── v2/
...
And thats it, no need to glue things together with 1000 require statements or having to guess at what URL leads to what code.
Then for instance inside index.route.js
we have something like this:
var ListUsers = {
handler: function(req, reply) {
reply({success: true});
}
};
exports.GET = ListUsers;
var AddUser = {
handler: function(req, reply) {
reply({success: true});
}
};
exports.POST = AddUser;
In this instance, the routes created from index.route.js
would be:
GET: /v1/user
POST: /v1/user
if the file were named lets say {urlParam}.route.js
it would have created:
GET: /v1/user/{urlParam}
POST: /v1/user/{urlParam}
Within file/folder names, any valid route path option for hapi is valid. Files without .route.js
are ignored.
The same goes for the route definitions, every exported method uses any valid hapi config.
exported param names are any valid HTTP verb. Anything else is simply ignored.
FAQs
(Under Development) Yet another route manager for versioned HAPI REST APIs
The npm package hapi-route-manager receives a total of 1 weekly downloads. As such, hapi-route-manager popularity was classified as not popular.
We found that hapi-route-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.