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

Make deployable to heroku; then it''ll be truly 30s to start as promised #309

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dheerajbhaskar
Copy link

@dheerajbhaskar dheerajbhaskar commented Jun 17, 2016

  • bind to proper port
  • add deploy button to readme
  • update npm start script to include db.json (please let me know if this can be done in a more elegant way; PROCFILE? I don't know how to use that)

ENV var PORT is given by heroku and we need to bind to it for it to work on heroku
- removed extra semicolon
- fixed unused portDefault
@dheerajbhaskar dheerajbhaskar changed the title #wip Make deployable to heroku; then it''ll be truly 30s to start as promised Make deployable to heroku; then it''ll be truly 30s to start as promised Jun 17, 2016
@dheerajbhaskar
Copy link
Author

Let's ship it!

@rustanacexd
Copy link

update on this one?

@dheerajbhaskar
Copy link
Author

dheerajbhaskar commented Nov 16, 2016

@rustanacexd not sure, the maintainers haven't accepted this yet, have been busy perhaps.

@maintainers please let me know if anything else is needed to merge this in.

PS: I know there's a merge conflict now, but I'm sure I can fix that quickly, need to know if this PR is even useful/ will be merged in

@typicode
Copy link
Owner

Sorry for not having replied earlier and thank you for the PR, it's a nice idea but unfortunately there's some caveats.

AFAIK Heroku doesn't allow writing to the file system, it's only possible to connect to databases to persist data. So if you deploy to Heroku you can't persist changes because JSON Server relies on the file system.

It's possible to do in memory changes, but at some point your dabatase will be reset to the one you've set.

And I don't know either how to set db.json.

Heroku is great and I'm using it for https://jsonplaceholder.typicode.com/ but since there's more options now (https://twitter.com/renaudin_yann/status/796810339509739521), I'd prefer to not add/maintain a specific deploy to heroku feature.

@dheerajbhaskar
Copy link
Author

I've this deployed on heroku. I've to check if adding via REST persists or
not. We've just been updating the db.json and pushing it.

Nonetheless it would be a good idea to give a deploy option for heroku with
this caveat.

Yeah, I overlooked the maintenance involved if you accept a PR. You'd be
the best judge to take a call, typicode.

Regards,
Dheeraj

On Wed, Nov 16, 2016, 5:25 PM typicode notifications@github.com wrote:

Sorry for not having replied earlier and thank you for the PR, it's a nice
idea but unfortunately there's some caveats.

AFAIK Heroku doesn't allow writing to the file system, it's only possible
to connect to databases to persist data. So if you deploy to Heroku you
can't persist changes because JSON Server relies on the file system.

It's possible to do in memory changes, but at some point your dabatase
will be reset to the one you've set.

And I don't know either how to set db.json.

Heroku is great and I'm using it for https://jsonplaceholder.typicode.com/
but since there's more options now (
https://twitter.com/renaudin_yann/status/796810339509739521), I'd prefer
to not add/maintain a specific deploy to heroku feature.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#309 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACzvja9wLleo91llJDknMvXh4B_DGRegks5q-u9FgaJpZM4I4Eel
.

--- Disclaimer --- The information in this mail is confidential and is
intended solely for addressee. Access to this mail by anyone else is
unauthorised. Copying or further distribution beyond the original recipient
may be unlawful. Any opinion expressed in this mail is that of sender and
does not necessarily reflect that of OSW Technologies Pvt Ltd.---

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.

3 participants