markkorput / pycfgr

cfgr is a text-based VPL that separates data from logic
MIT License
1 stars 1 forks source link

HttpServer, HttpHandler #2

Closed markkorput closed 5 years ago

markkorput commented 5 years ago

Example Implementation;

{
  "App": {"started":"#starthttp"},
  "App/HttpServer": {"port":8080, "start":"#starthttp", "request": "#httpreq"},

  "App/HttpScope": {"scope": "/public", "request-in": "#httpreq", "unscoped": "#staticreq"},
  "App/HttpStaticFileServer": {"path":"public", "request-in": "#staticreq"},

  "App/HttpScope": {"scope": "/api", "request-in": "#httpreq", "unscoped": "#apireq"},
  "App/HttpScope": {"scope":"/start", "request-in": "#apireq", "unscoped": "#action_start", "response":200},
  "App/HttpScope": {"scope":"/stop", "request-in": "#apireq", "unscoped": "#action_stop", "response":200}
}