bluejs
v0.0.3
Published
tiny tiny unstable, untested web framework
Downloads
10
Readme
bluejs
tiny tiny unstable, untested web framework
var app = require("bluejs")
// serve static files from the public directory
app.static("/public", path.join(__dirname, "public"));
//register route for a get request
app.route("/get")
.get()
.handler(function() {
this.res.end("poo");
});
// register route for a post request
// and parse the body into a javascript object
app.route("/post")
.post()
.handler(function() {
var self = this
this.parseBody(function(err, body) {
if (err) {
console.error(err.message);
return;
}
console.log("body", body);
self.res.end('cool');
});
});
app.server.listen(8080);