simple-simple-router
v0.0.1
Published
Simple node.js HTTP router with body and query parameters parsing.
Downloads
5
Readme
What is it
Very simple regex based node router with parsing body and query params.
How to
Install
npm install simple-routerUse
import { createServer } from "node:http";
import sr from './simple-router.js';
createServer(sr({
'login': (req, res) => {
console.log("parsed body: ", req.body)
console.log("parsed query params: ", req.params)
res.writeHead(200);
res.write('yoooo\n');
res.end();
}
})).listen(8080);