Skip to content

Commit

Permalink
Merge 099d304 into ec4d592
Browse files Browse the repository at this point in the history
  • Loading branch information
akinyeleolat committed Jul 8, 2019
2 parents ec4d592 + 099d304 commit 11b44b5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node app.js
16 changes: 16 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-console */
const express = require('express');
const cors = require('cors');
const path = require('path');

const app = express();
app.use(cors());
app.use(express.static(path.join(__dirname, './dist')));

app.get('*', (req, res) => {
res.header('X-XSS-Protection', 0);
res.status(200).sendFile(path.join(__dirname, './dist/index.html'));
});

const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Listening on ${port}`));
53 changes: 40 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"scripts": {
"test": "jest --coverage",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"heroku-postbuild": "npm run build",
"build": "webpack --env.mode production",
"start": "webpack-dev-server --env.mode development --open",
"test:dev": "jest src --watch",
Expand Down Expand Up @@ -92,6 +93,7 @@
"webpack-merge": "^4.2.1"
},
"dependencies": {
"cors": "^2.8.5",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
Expand Down

0 comments on commit 11b44b5

Please sign in to comment.