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

Herokuize project #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morenoh149
Copy link
Contributor

fixes #37

@morenoh149 morenoh149 force-pushed the hm-heroku branch 2 times, most recently from 410ac83 to 543e1f7 Compare February 22, 2019 23:27
* add build step to project
* add dev script
* instruct to use DATABASE_URL
* put morgan in dependencies
* inspired by
https://github.com/babel/example-node-server/blob/master/package.json
@morenoh149
Copy link
Contributor Author

I updated this pr to have the server restart via nodemon when the source changes. And the start script builds the server before serving.

@morenoh149
Copy link
Contributor Author

Why? The changes required to make the api run without issues in heroku do not prevent you from running it locally. These changes are just following best practices imo

@rwieruch
Copy link
Member

Thanks for your changes @morenoh149 I will take this change into account once I rewrite the tutorial for this application. Thanks for your help here 👍

@ACPK
Copy link

ACPK commented Jul 8, 2019

@morenoh149 I get the following error for this PR when I try to deploy it to Heroku:

2019-07-08T15:57:30.637694+00:00 heroku[web.1]: Starting process with command npm start
2019-07-08T15:57:33.209737+00:00 app[web.1]:
2019-07-08T15:57:33.209759+00:00 app[web.1]: > fullstack-apollo-express-postgresql-boilerplate@1.0.0 start /app
2019-07-08T15:57:33.209762+00:00 app[web.1]: > npm run build && node src/index.js
2019-07-08T15:57:33.209763+00:00 app[web.1]:
2019-07-08T15:57:33.683559+00:00 app[web.1]:
2019-07-08T15:57:33.683596+00:00 app[web.1]: > fullstack-apollo-express-postgresql-boilerplate@1.0.0 build /app
2019-07-08T15:57:33.683598+00:00 app[web.1]: > babel src --out-dir dist
2019-07-08T15:57:33.683600+00:00 app[web.1]:
2019-07-08T15:57:36.905982+00:00 app[web.1]: Successfully compiled 24 files with Babel.
2019-07-08T15:57:37.073024+00:00 app[web.1]: /app/src/index.js:3
2019-07-08T15:57:37.073028+00:00 app[web.1]: import 'dotenv/config';
2019-07-08T15:57:37.073030+00:00 app[web.1]: ^^^^^^^^^^^^^^^
2019-07-08T15:57:37.073031+00:00 app[web.1]:
2019-07-08T15:57:37.073037+00:00 app[web.1]: SyntaxError: Unexpected string

@morenoh149
Copy link
Contributor Author

that's javascript complaining that import is not valid js. You can fix this by fixing the babel config or writing your code with syntax that is supported by nodejs without transpilation. I can't advise as I'm not working on a node/graphql api atm. Shouldn't be too hard to figure out imo.

@ACPK
Copy link

ACPK commented Jul 9, 2019

@morenoh149 - I only did git clone and npm install.

@morenoh149
Copy link
Contributor Author

@ACPK this repo was not developed to work on heroku, that is why I opened this issue because I thought running on heroku would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to deploy on heroku? [Help Wanted.]
3 participants