1.0.4 • Published 5 years ago
@verticaldev/simple-express v1.0.4
:ocean: simple-express
Simple express wrapper written in Nodejs.
installation
Using npm:
npm i @verticaldev/simple-express
Example
const { route, listen, use, static } = require('@verticaldev/simple-express');
route["GET"]["/"] = request => {
return "<h1 style='color:red;'>Hello World</h1>"
}
route["GET"]["/hello"] = (req, res) => {
res.send("Hello npm :)")
}
route["GET"]["/:id"] = request => {
const { id } = request.params;
return { id }
}
listen(3000);