|
Motion Master 6.0.0-alpha.86
Next-generation motion control software
|
Registers routes whose handlers run off the event loop. More...
#include <router.h>
Public Member Functions | |
| Router (uWS::SSLApp &app, uWS::Loop *loop, BS::light_thread_pool &pool, const std::atomic< bool > &stopping, std::string_view corsOrigin) | |
| void | get (const std::string &pattern, Handler handler) |
Registers handler for GET pattern. Path parameters are :name as in uWS. | |
| void | post (const std::string &pattern, Handler handler) |
Registers handler for POST pattern; the body is accumulated before dispatch. | |
| void | put (const std::string &pattern, Handler handler) |
Registers handler for PUT pattern; the body is accumulated before dispatch. | |
| void | del (const std::string &pattern, Handler handler) |
Registers handler for DELETE pattern. | |
Registers routes whose handlers run off the event loop.
Holds no ownership: the app, loop, pool and CORS origin all outlive it, and it is used only during registration.
|
inline |
| app | The uWS app to register on. |
| loop | The app's loop; responses are written by deferring onto it. |
| pool | Workers the handlers run on. Must be drained before loop is closed. |
| stopping | Set once shutdown starts; while it is set, requests are answered 503 instead of being dispatched. See stopping_. |
| corsOrigin | Value for Access-Control-Allow-Origin; must outlive the server. |
|
inline |
Registers handler for DELETE pattern.
|
inline |
Registers handler for GET pattern. Path parameters are :name as in uWS.
|
inline |
Registers handler for POST pattern; the body is accumulated before dispatch.
|
inline |
Registers handler for PUT pattern; the body is accumulated before dispatch.