@sebi2020/http_route

allows programmers to specify route for the http_module

Usage no npm install needed!

<script type="module">
  import sebi2020HttpRoute from 'https://cdn.skypack.dev/@sebi2020/http_route';
</script>

README

http_route

Build Status 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)