Server for WM Classified.
Example:
fetch(URL + '/catalog/semesters')
Response: an array of available semesters
[ 'fall_2015', 'spring_2016' ]
Example:
fetch(URL + '/catalog/spring_2016')
Response: an array of all courses for the given semester
[
{
status: "OPEN",
attr: " ",
creditHours: "3",
courseId: "MATH 311 01 ",
meetTimes: "1300-1350",
title: "Elementary Analysis",
meetDays: "MWF ",
currEnr: "23",
instructor: "Humber, Cary",
crn: "20232",
seatsAvail: "2"
},
{
status: "OPEN",
attr: "MATO",
creditHours: "3",
courseId: "MATH 323 01 ",
meetTimes: "0930-1050",
title: "Intro Operations Research I",
meetDays: "TR ",
currEnr: "23",
instructor: "Ninh, Anh",
crn: "24060",
seatsAvail: "12*"
}
]
Example:
fetch(URL + '/posts/spring_2016')
Response: an array of posts for a given semester
[
{
"courseId":"ANTH 150 01 ",
"emails":[
"[email protected]"
]
},
{
"courseId":"APSC 401 01 ",
"emails":[
"[email protected]"
]
}
]
Example:
fetch(URL + '/requests/spring_2016')
Response: an array of requests for a given semester
[
{
"courseId":"ANTH 150 01 ",
"emails":[
"[email protected]"
]
},
{
"courseId":"APSC 401 01 ",
"emails":[
"[email protected]"
]
}
]
The request body must be a JSON object structured like so:
{
'courseId': <String>
'email': <String>
}
Example:
fetch(`${URL}/submit/post/spring_2016`, {
method: 'POST',
headers: new Headers({ 'Content-Type': 'application/json' }),
body: JSON.stringify({ courseId: 'APSC 401 01 ', email: '[email protected]' })
})
Response:
ok
: the data was successfully added400
: the requested semester is not available
The request body must be a JSON object structured like so:
{
'courseId': <String>
'email': <String>
}
Example
fetch(`${URL}/submit/request/spring_2016`, {
method: 'POST',
headers: new Headers({ 'Content-Type': 'application/json' }),
body: JSON.stringify({ courseId: 'APSC 401 01 ', email: '[email protected]' })
})
Response:
ok
: the data was successfully added400
: the requested semester is not available
Depends on a global install of babel-cli
npm i -g babel-cli
For development, run:
npm install
npm start
The server will be listening on port 8080