-
Notifications
You must be signed in to change notification settings - Fork 37
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
Make heroku friendly #5
Open
fembem
wants to merge
19
commits into
cornflourblue:master
Choose a base branch
from
fembem:make-heroku-friendly
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fembem
force-pushed
the
make-heroku-friendly
branch
from
July 15, 2020 19:27
cf6f2ac
to
1ed8079
Compare
fembem
force-pushed
the
make-heroku-friendly
branch
4 times, most recently
from
July 16, 2020 05:27
4babae5
to
711e57b
Compare
fembem
force-pushed
the
make-heroku-friendly
branch
from
July 16, 2020 05:46
711e57b
to
1a84e79
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To make this app suitable for deploying to Heroku, I moved package.json to the root directory, as Heroku requires that.
To avoid then having to change a lot of require paths, I moved the contents of the server directory into the root directory as well, which is consistent with common practice. This app uses some server side templates, so can't be split up into a client and a server running on separate machines. Therefore eliminating the server directory has less downside to it.
Gulp and gulp plugin dependencies didn't specify a version, and the newest versions weren't compatible with the gulpfile.js code. The gulp file code doesn't work with version 4, so I set it to version 3, which is contemporaneous to the project code. Gulp version 3 is not compatible with the most recent node versions, so I set the node version to 11.15.0 in package.json. I also set all gulp plugin versions to ones contemporaneous with the project code.
Since Heroku has ephemeral storage, I added the ability to save image files to Mongo. The storage mode is decided at app launch by a config var or by an environment variable. On platforms with both storage options, switching between modes will not make previously uploaded images inaccessible, as the two storage modes use a different file path prefix.
The blog name and Disqus app name have also been extracted into config & environment variables for blog customization.
Lastly, I added an npm build task for the javascript and css assets, which Heroku will run automatically on app deploy.