Commit 797d6e84 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Merge branch 'issue8' into '8-ics-generation'

Issue8 lets fix this mess

trying to fix a mess...oops

See merge request !9
parents cc8928d3 8e914516
......@@ -8,6 +8,7 @@ var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Semester = require('../../models/Semester');
var ical = require('ical-generator');
// Load site wide configurations
var config = require('../../config');
......@@ -45,5 +46,20 @@ router.get('/json/classes/:SEMSLUG', function(req, res, next) {
////////////////////////////////////////////////////////////////////////////////
// ICAL API Section
router.get('/ical/:SCHOOL/:SEMSLUG/:CLASSES', function(req, res, next) {
var schoolSlug = req.params['SCHOOL'];
var semSlug = req.params['SEMSLUG'];
var classes = req.params['CLASSES'];
// Generate blank calendar
cal = ical({domain: 'schedules.gmu.edu', name: 'SRCT Schedules Generated Calendar'});
res.set({
'Content-Type': 'text/calendar; charset=utf-8',
'Content-Disposition': 'attachment; filename="' + ('calendar.ics') + '"'
});
res.send(cal.toString());;
})
module.exports = 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