Classes: SlimmingWorldServer

SlimmingWorldServer

Server class that serves our app


new SlimmingWorldServer( [afterStoreHook] [, afterStart])

Parameters:
Name Type Argument Description
afterStoreHook function <optional>

Will be called when the store is created, so you can dispatch actions to add stuff in the store. Will pass the store as first parameter, and the express request object as second.

afterStart function <optional>

Will be called after the server has started

Source:

Methods


close()

Helper function called when executing stop(). Will close the currently running http server so a new one can be started.

Source:

initMiddleware()

Initializes the default routes and middleware for the server. Should only be called once.

Source:

listen()

Helper function called when executing start(). Will cause express to start listening on the configured port. All routes should be setup before calling this method.

Source:

logRequests()

Setup middleware to log all requests through the debug module

Source:

serveBuildAssetFiles()

Enables serving web assets from the build folder

Source:

serveStaticFiles()

Enables serving static files from the build folder.

Source:

setupHTTPSHeader()

If the header x-iisnode-https is set by iisnode, set the more standardized header x-forwarded-proto

Source:

setupRaven()

Sets up raven for reporting NodeJS rendering issues to Sentry

Source:

setupRavenErrorHandler()

Sets up raven error handling middleware for reporting NodeJS rendering issues to Sentry

Source:

start()

All middleware that should be mounted before the regular routing should be added before calling this function.

Source:

stop()

Stops the currently running express instance

Source: