This is an expressjs application written by Collin De Kalb to display room reservation information from the LibCal system.
- Nodejs
- npm
In order to run the application you must have a json file called creds.json in the root of the project. The file should look like this:
{
"client_id":"X",
"client_secret":"Y",
"grant_type":"client_credentials"
}- Navigate to the root directory and type
npm installto install dependencies. - Type
npm startto start the server - Make GET requests to the endpoints to receive the formatted html. By default the server is started on port 3000 of localhost.
/api/todayThis gives you the reservations for the group study rooms today/api/not_groupThis gives you the reservations for all rooms that aren't the group study rooms today/api/teachThis gives the reservations of teaching and learning rooms for the next seven days
- Endpoints are defined in the file
/routes/api.js - Html is written using the pug template engine and can be found in
/views- edit
layout.pugfor base html edits like changing the head and editindex.pugfor tweaking the room listings
- edit
- JS functions are found in
/public/javascripts/groupstudy.jsis responsible for groupstudy roomseverythingelse.jsis responsible for everything except groupstudy roomsteachlearn.jsis responsible for teaching and learning roomsdate.jsis responsible for date functionsnicknames.jsis responsible for making the nickname get requests to the apiauth.jsis responsible for the auth functions and supplying the bearer token- To edit what data is passed to
index.pugcheck for theres.rendercall in the first three js files.