A simple package to help you route your express application in an elegant manner

Usage no npm install needed!

<script type="module">
  import expressRoutingSimple from '';


Simple express routing


  • Helps you structure your code very well and keeps things simple.
  • Add routing to your application with ease


  • First initialize the package in your main file once by importing and calling the setup function


  • const routing = require('express-routing)

  • routing.Setup(array);

  • You just have to pass an array of objects with the following properties


"method": "get", "route": "/dd", "middleware": [function1, function2], "controller": kofi, }

  • Each object represents one endpoint

  • Method is of the type string either "get" or "post"

  • route is also of the type string, that is the endpoint for the url

  • middleware is of the type array, that contains all the functions you want to call before getting to the controller that will send data back to the user and perform other functions or even send back a page;

  • controller is the final function that will take care of sending feedback to the user

  • Pls note that you can leave out middleware if you don't need it and just have three properties. If you however use it, remember to attach the function next() so the req is passed unto the next function till it gets to the controller.

  • After passing the newly formed array to the setup, just call

  • app.use('/', routing.getRouter());


  • var route = routing.getRouter();
  • app.use('/', route); ... ...
  • app.listen(port)

You are good to go



  • npm i express-routing-simple