From 8f016c08567bad1ba71011d8d6f7fcfc0f85140a Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 16 Jan 2017 10:35:03 +0100 Subject: [PATCH] Add web server for Heroku --- Procfile | 1 + bin/heroku/web.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 bin/heroku/web.js diff --git a/Procfile b/Procfile index 1d79f8be76..634773f91f 100644 --- a/Procfile +++ b/Procfile @@ -1 +1,2 @@ renovate: node renovate +web: node bin/heroku/web.js diff --git a/bin/heroku/web.js b/bin/heroku/web.js new file mode 100644 index 0000000000..bf92ce79e2 --- /dev/null +++ b/bin/heroku/web.js @@ -0,0 +1,18 @@ +/* eslint-disable no-console */ +const http = require('http'); + +const port = process.env.PORT || '3000'; + +const requestHandler = (request, response) => { + // Redirect users to Heroku dashboard + response.writeHead(302, { Location: 'https://dashboard.heroku.com/apps' }); + response.end(); +}; + +http.createServer(requestHandler).listen(port, (err) => { + if (err) { + console.log('Failed to start web server', err); + return; + } + console.log(`Web server is listening on ${port}`); +});