| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Only for learning! Not for production! This is an example of a simple router implementation.
const SimpleRouter = require("./router");
const app = new SimpleRouter();
app.use((req, res, next) => {
console.log("Hello world!");
next();
});
app.post('/', (req, res, next) => {
res.end('POST /');
});
or
app.get('/', (req, res, next) => {
res.end('GET /');
});
app.listen(port);
You can find an example of usage in the index.js file
| Back | FazBrowse Home | New Git URL |