Commit dcbfae95 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Added documentation headers to several files

- to make the project easier to get into, I'm
  documenting each of the files in a much more
  verbose manner.
parent c7094fa8
////////////////////////////////////////////////////////////////////////////////
// Mason SRCT: Schedules Application Main File
// - This is the main file for the schedules app, which loads in all of the
// configuration and routing files. Essentially, any other file eventually
// leads here.
// - Take care with this file, it can hurt if you mess it up.
////////////////////////////////////////////////////////////////////////////////
// Load in the different packages
var express = require('express');
var path = require('path');
var logger = require('morgan');
......@@ -10,10 +19,12 @@ var mongooseRedisCache = require("mongoose-redis-cache");
var config = require('./config');
// Load in Routes
// TODO: Make this a dynamic loading system that simply scans the directory
var routes = require('./routes/index');
var docs = require('./routes/docs');
var apiV1 = require('./routes/api/v1');
// Instantiate the application
var app = express();
// view engine setup
......@@ -34,12 +45,15 @@ app.use(express.static(path.join(__dirname, 'public')));
// Connect to mongo
mongoose.connect(config.mongoDBURL);
// Setup the mongo redis caching for performance
mongooseRedisCache(mongoose);
// Populate initial data
var populateDB = require('./setup/populateDB');
populateDB();
// Actually use the loaded routes
// TODO: make this automatic instead of being manually entered
app.use('/', routes);
app.use('/docs', docs);
app.use('/api/v1', apiV1);
......
////////////////////////////////////////////////////////////////////////////////
// Mason SRCT: Schedules Main Configuration File
// - This file holds many of the global options for ease of use. Some of these
// settings are temporary because the dynamic methods have not been written in
// yet.
////////////////////////////////////////////////////////////////////////////////
var config = {}
// Application Name
......
////////////////////////////////////////////////////////////////////////////////
// Mason SRCT: Schedules Documentation Routes
// - This routing file is for the documentation behind the scheduels app
// - Most of these should really just be basic render functions without anything
// more complex that that.
////////////////////////////////////////////////////////////////////////////////
var express = require('express');
var router = express.Router();
......
////////////////////////////////////////////////////////////////////////////////
// Mason SRCT: Schedules Main App Routes
// - This routing file describes the main front-end's routing.
// - This serves the root page as well as parses preset url's generated by the
// application
////////////////////////////////////////////////////////////////////////////////
var express = require('express');
var router = express.Router();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment