Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
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
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.