Routed Webserver

Know where you belong.

Creating a webserver can be a little shitty from time to time. Even more so when you experienced web development.
This component will make setting up a webserver a little easier by giving you some tools we know. Routes, parsing etc.

  • Active : Is the webserver active?
  • Restart : Restart the webserver.
  • Port: On which port should the server listen?
  • Create Routes: Creates an example route-definition.
  • Routes: The path to the routedefinition.

Routes are define as a dict in the routedefinition and first define the request-type and then the uri.
Prefixing a uri-member with a : converts it to a parameter and will be a wildcard that is then passed to the handler in the params dict.
A handler takes three arguments: 
  1. Params : query-params passed via the url
  2. Route : parsed route-wildcards as a dict.
  3. Parsed Body: The body of the request. If it is json-formatted it will be parsed as a dict.

Downloads: 25

Created at: 6.8.2021

Uploaded: 2.9.2021
Added a DEFAULT route that gets triggered when no other route is a match. Can be removed when a 404 should be returned instead,