Skip to content
Snippets Groups Projects
Commit 8f016c08 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

Add web server for Heroku

parent 86f2e37a
No related branches found
No related tags found
No related merge requests found
renovate: node renovate
web: node bin/heroku/web.js
/* 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}`);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment