wideweb v1.4.7
wideweb
Micro framework for the web
About
This tool provides a CLI that aims at scaffolding the fundamental structure of a web application and a fast web engine by putting together best in class libraries neatly integrated with minimal glue code and sensible defaults, making it for a lean but resourceful project foundation.
Usage
npm install wideweb -g
wideweb new app-name
cd app-name
npm start
Adding routes
Edit the sample server.js on our new app and add new functions, they will be routed automatically, e.g.
wideweb.route({
getRoot: (req, res) => {
res.render("index.html");
},
getHello: (req, res) => {
res.send("Hello, world!");
}
});
Thanks to a simple convention, the new function will be accessible under http://localhost:3000/hello via GET HTTP method, without the need to manually create complicated or redundant routing, as the function name is the route and vice-versa, while the req
and res
parameters are pure express objects and we can also render views as demonstrated above.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago