Unverified Commit b90d2d89 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Refine API further

- Not ideal yet, but technically the app can work just from this api
parent a1c579fb
......@@ -10,9 +10,18 @@ config.mongoDBURL = 'mongodb://localhost/schedules';
config.ReloadDB = false;
config.schoolSlugs = {
// Slug: Long Name
'GMU': 'George Mason University',
'VT' : 'Virginia Tech'
'GMU': {
'longName': 'George Mason University',
'semesters': [
{'GMU2016F': 'Fall 2016'},
{'GMU2016S': 'Summer 2016'},
{'GMU2016SP': 'Spring 2016'}
]
},
'VT' : {
'longName': 'Virginia Tech',
'semesters': []
},
}
// Data files to load:
......
......@@ -15,18 +15,11 @@ var config = require('../../config');
////////////////////////////////////////////////////////////////////////////////
// JSON API Section
// Get school and school slug listing
// Get school and semester slug listing
router.get('/json/schools', function(req, res, next) {
res.json(config.schoolSlugs);
});
// TODO: FINISH THIS
// Get semester and semester slug listing for a given school
router.get('/json/semesters/:SCHOOL', function(req, res, next) {
var schoolSlug = req.params['SCHOOL'];
res.json({'TODO': schoolSlug});
});
// GET classes for a semester
router.get('/json/classes/:SEMSLUG', function(req, res, next) {
var slug = req.params['SEMSLUG'];
......
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