Skip to content

Development Document

jason humphrey edited this page Mar 12, 2018 · 1 revision

Mean

Mean Stack Server File

Parameters

  • opts Object the options passed to create the server
  • done Function the callback function MIT Licensed

self

self context to be used through out the application

dir

stores the root directory at dir

opts

stores the options pass in to the server

run

stores the run function incase you need to spin up any other servers

logger

creates the logging throught the entire app

environment

gets & store the current environment

settings

gets & store the current settings based off of the environment

port

sets the port based on the options or settings

middleware

sets up all middleware & placed after db connect to give middleware access

mail

sets up mailer after db connect to give it access

mongoDB

Connect to MongoDb & Register mongoose schemas

registerSystemInfo

setupRegister > Used to gather all modules to gether and to register them properly

configMiddleware

setupExpressConfigs > Used to set up expressjs initially, middleware & passport.

passport

setupAuthentication > Used to set up passport authentication & sessions

securityMiddleware

setupExpressSecurity > Used to set up helmet, hpp, cors & content length.

headersMiddleware

setupExpressHeaders > Used to set up the headers that go out on every route.

loggerMiddleware

setupExpressLogger > Used to set up our morgan logger & debug statements on all routes.

setupTools

setupTools > Used to set up every tool in the tools directory.

buildRoutes

setupStaticRoutes > Used to set up all system static routes including the main '/*' route with ejs templating.

errorMiddleware

errorMiddleware > Used to set up our customer error handler in the server folder. NOTE: This goes after routes because we do not want it potentally default to express error handler

maxCDN

maxCDN - _ OPTIONAL _ > Used to purge the max cdn cache of the file. We Support MAXCDN

auto

auto - connectMongoDb : server > Used to finsh the final set up of the server. at the same time we start connecting to mongo and turning on the server.

SocketIO

Mean Stack SocketIO Server File

Parameters

  • opts Object the options passed to create the server
  • done Function the callback function MIT Licensed
Clone this wiki locally