Skip to content

Instantly share code, notes, and snippets.

@Ang3lFir3
Created August 7, 2012 01:25
Show Gist options
  • Save Ang3lFir3/3280432 to your computer and use it in GitHub Desktop.
Save Ang3lFir3/3280432 to your computer and use it in GitHub Desktop.
scalac server sample
{
"name": "scalac",
"version": "0.0.1",
"description": "jsonified SCA calendar data",
"author": "Ang3lFir3",
"dependencies": {
"ical": "*"
},
"engines": {
"node": ">= 0.6.0",
"npm": "1.1.41"
}
}
var http = require('http');
var ical = require('ical');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'application/json'});
ical.fromURL('http://antir.sca.org/Upcoming/allevents.ics',{},
function(err, data){
res.end(JSON.stringify(data));
});
}).listen(process.env.PORT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment