Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mattias J Duffy
schedules
Commits
b90d2d89
Unverified
Commit
b90d2d89
authored
Aug 07, 2016
by
Mark Stenglein
Browse files
Refine API further
- Not ideal yet, but technically the app can work just from this api
parent
a1c579fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
schedules/config.js
View file @
b90d2d89
...
...
@@ -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:
...
...
schedules/routes/api/v1.js
View file @
b90d2d89
...
...
@@ -15,18 +15,11 @@ var config = require('../../config');
////////////////////////////////////////////////////////////////////////////////
// JSON API Section
// Get school and s
chool
slug listing
// Get school and s
emester
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
'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment