This use the routes and the reqeuest found in the http directory and
move all files but main to the http directory
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The route object is the url dispatcher, it uses it matching rules to
find what handler should handle a request, perform the call and handle
exceptions that hanend during the handling.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This is a migration of the basic json support taken from the
osv/httpserver.
The routes uses the json object to return errors in a json format.
This also adds json_exception which has a constructor from an exception.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The matcher and match rules are used to define and match a url rule. A
rule define a list of string and parameters.
For example, the rule /api/get/{id}/name
Will be mapped by the list of matcher:
str_match for /api/get
param_match for the {id}
and str_match for name
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The class handler_base is a base class for all handlers. All handlers
should inherit and implement the handle method.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The request object was originally taken from the boost server example
and was modified in the OSv http implementation.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>