
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Like every other Rails dev teaching themselves node I decided my first project would be to write my own app framework. Since it took me a day longer to discover express than it should have I actually got it working and then unwisely built some other stuff on on top of it, so now I'm releasing it a poor attempt to justify abusing NPM as my personal code repository/dependency manager. You're welcome to use it for any purpose you see fit, but I really can't recommend that you do, it's not stable, well-tested, well-thought-out, nor, well, well-anything.
npm install bobsled
or
git clone http://github.com/femto113/node-bobsled.git
cd node-bobsled
npm link
var Bobsled = require("bobsled").Bobsled;
var bobsled = new Bobsled();
bobsled.routes.GET["/helloworld"] = {
"*": function (pathinfo, request, response) {
response.writeHead(200, {"content-type": "text/plain"});
response.end("hello world");
}
};
bobsled.start();
The basic use of bobsled is to construct a server and then assign a controller function to a route. Routes are structured as a nested hash of METHOD, PATH, and BASENAME. "*" serves as a wildcard for any basename that doesn't have an explicit route (but don't assume that means there's real globbing going on...). This means that in the above example the given route will match "/helloworld/foo.html", but not "/helloworld.html", that could be matched instead by {{GET["/"]["helloworld"]}}. The first argument to controllers ({{pathinfo}} in the example above) is an object containing deconstructed elements of the URL, including the parsed querystring or posted body if any.
The default Bobsled server isn't very capable (essentially just router for http requests) but it also has no dependencies. More advanced functionality, including view templates can be enabled by passing a "recipe" to the constructor. The default recipe is available as
var recipe = require("bobsled").recipes.bobsled();
About the only redeemable features of the default recipe is that it uses the the awesomely fast doT.js template library (if it's been installed), but even that it perverts with ASP style delimiters (<% %>) instead of mustache.
FAQs
a fast, simple app framework prone to violent crashes
We found that bobsled 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.