Macro jumpdrive
jumpdrive!() { /* proc-macro */ }
Expand description
The primary entrypoint for Jumpdrive.
§Example:
jumpdrive! {
dir = "public/",
ws = "/ws": websocket_handler,
routes = {
"/csv": csv_server
},
err = error_handler
}
§Required fields:
- dir: the path of a directory relative to
CARGO_MANIFEST_DIR
- err: a callback function which executes upon encountering errors
§Optional fields:
- ws:
- an endpoint to serve Websocket connections, and
- a callback function which executes when a new Websocket connection is established
- routes: a list of
- endpoints, and
- callback functions which execute when a
GET
request is made to their endpoint