Requiring this module runs the app. It is, for instance, required
by the CLI interface (.bin/blend-demo
) when it is done setting up.
Create the core web app container (app
), bind and HTTP server to it
(server
) and determine the full path for public assets.
Configuration and middleware for all environments (dev, prod, etc.)
This is not Adobe's Flash! This is session flashes--messages that are only retained until the next view rendered for the session.
Passport initialization (authentication middleware and schemes)
Static file serving
Make the session flash and params readable by all views
Shared locals for all views
Development-only configuration (full error logging)
Because Express will automatically insert the Router middleware as soon as we define a route, we need to run our subapp setups in two blocks: middlewares first, then routes.
If you have a proper Arduino board connected (check the annotated
source of the arduino.js
module), uncomment that line to start
the module.
require('./arduino');
This actually launches the server by listening on the relevant port for incoming HTTP connections. The default port is 3000.
App entry point