@sebi2020/http_route

allows programmers to specify route for the http_module


Keywords
HTTP, routing, router
License
GPL-3.0
Install
npm install @sebi2020/http_route@0.2.0

Documentation

http_route

A nodejs module for routing of pretty urls.

Use

http_route.addRoute("GET", "/my/url/:param1", callback_function);

The callback function should have the following signature:

function callback_function(req, res, route)

routecontains the parameters For more information look at the Documentation

In your createServer callback, call http_route.route(req,res,pageNotFoundHandler)

The pageNotFoundHandler function should have the following signature:

function pageNotFoundHandler(req, res)