app

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.

Events

get

GET / : redirects the user to a room with an ID generated by UUID v4

Parameters:
NameTypeAttributesDescription
pathstring<optional>

The path for which the GET will act on

callbackfunction<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

Parameters:
NameTypeAttributesDescription
pathstring<optional>

The path for which the GET will act on, parametrized with :

callbackfunction<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

Parameters:
NameTypeAttributesDescription
pathstring<optional>

The path for which the GET will act on, parametrized with :

callbackfunction<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.