
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
sails-controller-driven-routing
Advanced tools
A routing configuration similar to blueprint that reads the routes from the controller so everything is kept in one place
A routing configuration similar to blueprint that reads the routes from the controller so everything is kept in one place
It relies on blueprints validating your configuration (because I didn't want to copy/paste), but you could maybe disable blueprints entirely in production if you're feeling courageous and don't need any of its helpers.
n
accessible pointsrouting.js
switch()
at the top of each exposed method.$ npm instal sails-controller-driven-routing
Your controller can now look like the following:
MyController.js
module.exports = {
_config: {
actions: false, //disable built in blueprints
shortcuts: false, //disable built in blueprints
rest: false, //disable built in blueprints
explicitRoutes: {
'OPTIONS /hello/world': 'mycontroller.world'
},
exposedMethods: [
'foobar'
]
},
world: function(res, req) {
return res.ok("hello");
},
foobar: function(res, req) {
return res.ok("bar");
},
foobarPost: function(res, req) {
return res.ok("par");
},
};
Now:
OPTIONS /hello/world
will respond with hello
GET/POST/DELETE/OPTIONS/PUT/etc /mycontroller/foobar
will respond with bar
POST /mycontroller/foobar
will respond with par
You can also specify a prefix
that'll work the same way as blueprints ones do which will override the 'mycontroller' segment of the url for the exposedMethods
section.
Hopefully this will prove useful to someone else, pull requests welcome if you want to tidy it up a bit :)
FAQs
A routing configuration similar to blueprint that reads the routes from the controller so everything is kept in one place
The npm package sails-controller-driven-routing receives a total of 119 weekly downloads. As such, sails-controller-driven-routing popularity was classified as not popular.
We found that sails-controller-driven-routing 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
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.