-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
23 lines (23 loc) · 884 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// <reference path="typings/node/node.d.ts" />
/// <reference path="typings/express/express.d.ts" />
"use strict";
var express = require('express');
var request = require('request');
var app = express();
app.use(express.static("public")); //serve statics from /public
app.post("/getSessions", function (req, res) {
request("https://www.thatconference.com/api3/Session/GetAcceptedSessionsByTimeslot", function (error, response, body) {
if (!error && response.statusCode == 200) {
res.json(JSON.parse(body));
}
else {
res.status(response.statusCode).json(error);
}
});
});
var server = app.listen(process.env.PORT || 8080, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
//# sourceMappingURL=app.js.map