From fa59ca6064ce9400adb1765deeb960bfe51c2f6f Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 25 Feb 2023 12:09:53 -0800 Subject: Begin work on custom webserver oatpp was a crashy mess. Begin making a simple web server from scratch. * Add Designs/ folder to document nontrivial things like the webserver design --- Designs/webserver_design.md | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Designs/webserver_design.md (limited to 'Designs') diff --git a/Designs/webserver_design.md b/Designs/webserver_design.md new file mode 100644 index 0000000..c6b61ef --- /dev/null +++ b/Designs/webserver_design.md @@ -0,0 +1,76 @@ +This is the API design of the webserver supporting the browser source. + +I tried oatpp but it had a nasty habit of randomly crashing. I looked at +crowCPP but it depends on boost, which I have a personal grudge against. +So I'm making Yet Another Web Framework. + +This one supports only the minimum feature set required to implement the +browser source. + +The browser source requires two APIs: +1. GET /: return index.html (html) +2. GET /api/transcript: return transcript (json) + +``` +enum ContentType { + HTTP, + JSON, +}; + +class WebServer: +public: + WebServer(u16 port) + + // method and path are in-params + // payload and type are out-params + typedef handler_t std::function