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 #7

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ This is my "training" repository. I put here every trick that is possible. It do

This repo serves as a companion to the [tutorial of the same name, over on Medium](https://medium.com/superhighfives/).

## Heroku deployment

```
heroku create
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku buildpacks:add https://github.com/jontewks/puppeteer-heroku-buildpack.git
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static.git
git push heroku react-snap:master -f
heroku ps:scale web=1
```

## Load performance optimization

Read more [here](https://github.com/stereobooster/react-snap/blob/master/doc/an-almost-static-stack-optimization.md).
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@
"generate-appcache": "node scripts/generate-appcache.js",
"aws-deploy": "node scripts/aws-deploy.js",
"deploy": "yarn run build && yarn run generate-fb && firebase deploy",
"prettier": "prettier --write {*,scripts/*,src/*}.{js,json,css}"
"prettier": "prettier --write {*,scripts/*,src/*}.{js,json,css}",
"postinstall": "yarn run build"
},
"reactSnap": {
"cacheAjaxRequests": true,
"inlineCss": true,
"http2PushManifest": true,
"include": ["/shell.html"]
"include": ["/shell.html"],
"puppeteerArgs": ["--no-sandbox", "--disable-setuid-sandbox"]
},
"engines": {
"node": "8.6.0",
"yarn": "1.3.2"
}
}
11 changes: 11 additions & 0 deletions static.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"root": "build/",
"headers": {
"/service-worker.js": {
"Cache-Control": "max-age=0"
},
"/static/**": {
"Cache-Control": "public, max-age=31536000"
}
}
}