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:
- Params : query-params passed via the url
- Route : parsed route-wildcards as a dict.
- Parsed Body: The body of the request. If it is json-formatted it will be parsed as a dict.