Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku #5

Merged
merged 12 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cors
  • Loading branch information
komalsingh54 committed Apr 11, 2020
commit 6db712209cdf7aaec85ff77b2ebaa720765edcf2
9 changes: 9 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"core-js": "^3.6.5",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"global": "^4.4.0",
Expand Down
8 changes: 8 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import express from 'express';
import compression from 'compression';
import cookieParser from 'cookie-parser';
import cors from 'cors';


import handleRender from './handleRender';

Expand All @@ -11,10 +13,16 @@ const port = process.env.PORT || 54370;

app.use(compression());
app.use(cookieParser());
app.use(cors());

app.use('/dist', express.static('dist'));
app.use('/', express.static('public'));

app.use('/', (req, res, next) => {
console.log(req.url);
next();
});

app.use(handleRender);

app.listen(port, () => {
Expand Down