From fd7262bebcd6aff7e3ad229bd9e737816a2b23bc Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 4 Sep 2016 22:17:14 +0200 Subject: Init commit --- routes/index.js | 9 +++++++++ routes/meetingpointProxy.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 routes/index.js create mode 100644 routes/meetingpointProxy.js (limited to 'routes') diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 0000000..72068ff --- /dev/null +++ b/routes/index.js @@ -0,0 +1,9 @@ +var express = require('express') +var router = express.Router() + +/* GET home page. */ +router.get('/', function (req, res, next) { + res.render('index') +}) + +module.exports = router diff --git a/routes/meetingpointProxy.js b/routes/meetingpointProxy.js new file mode 100644 index 0000000..1b70beb --- /dev/null +++ b/routes/meetingpointProxy.js @@ -0,0 +1,14 @@ +var express = require('express') +var router = express.Router() +const Promise = require('bluebird') +const request = Promise.promisify(require('request')) + +/* GET home page. */ +router.get('/:url', function (req, res, next) { + request(`http://www.meetingpointmco.nl/${req.params.url}`) + .then(raw => raw.body) + .then(body => { res.end(body) }) + .catch(next) +}) + +module.exports = router -- cgit v1.1