new app()
The app instance for serving webpage and routing data to any client. Requires no params for instantiation in the context of the server and its default settings.
- app#event:use
- app#event:set
- app#event:get
- app#event:on
Events
get
GET / : redirects the user to a room with an ID generated by UUID v4
| Name | Type | Attributes | Description |
|---|---|---|---|
path | string | <optional> | The path for which the GET will act on |
callback | function | <optional> | The function with request and response pair that runs when the endpoint is hit |
get
GET /:room : Parametrized room route that serves back the view/room.ejs file with the given room ID
| Name | Type | Attributes | Description |
|---|---|---|---|
path | string | <optional> | The path for which the GET will act on, parametrized with : |
callback | function | <optional> | The function with request and response pair that runs when the endpoint is hit |
get
GET /:room/close : Route that shuts down the server when hit
| Name | Type | Attributes | Description |
|---|---|---|---|
path | string | <optional> | The path for which the GET will act on, parametrized with : |
callback | function | <optional> | The function with request and response pair that runs when the endpoint is hit |
set
Sets various configs for the express app; in the context of Spark, it's only used to set the view engine from HTML to EJS files.
use
Applies CORS for all requests.
use
Tells the express app to reference any static files to serve under the project's public directory.
use
Tells the express app to reference the instantiated rate limiter rules.