shaunymca / coffeeapp

An app to let your slack coffee group know when there's coffee
18 stars 4 forks source link

http://localhost:3000/jsonette.json doesn't seem to load #2

Open kqdtran opened 7 years ago

kqdtran commented 7 years ago

Hi Shaun!

I came across this repo and learned about Jasonette through a HN post. I've tried to clone this repo and created a .env file, but the URL http://localhost:3000/jsonette.json doesn't seem to load for me (on Chrome, the page keeps loading until timeout with the message "Waiting for localhost"). I've checked the default port and everything -- but as a JS newbie, I wasn't able to debug what's going on.

Let me know if there's anything I could do to provide more helpful debugging information.

As a follow-up question, I'm not sure how to point the Jason Android app toward the server running on localhost. Should I be thinking about hosting this code on an external service like heroku?

shaunymca commented 7 years ago

Hi @kqdtran, could you pull the most recent commits in? I wasn't expecting anyone to use this yet and I fixed some bugs that should make it easier to use. If you have the environment fields set up, you should get back json in the browser when you visit http://localhost:3000/jsonette.json.

Pointing the Jason app at localhost won't work, you're right. You'll need to host the server on heroku or similar. The values you have in the .env file would not be uploaded, so you'll need to input those values in the settings of the heroku app as environment values.

I plan on adding some more information on deployment in the readme, sorry for any confusion!

kqdtran commented 7 years ago

Thanks for getting back to me @shaunymca! I tried git pull and checked the .env file, but there was no difference. Strangely enough, I checked out an earlier commit SHA 7a4830427abad2a0feed5c8bd7b9b36bb491527c https://github.com/shaunymca/coffeeapp/commit/7a4830427abad2a0feed5c8bd7b9b36bb491527c and was able to see the generated json at http://localhost:3000/jsonette.json. Perhaps I'm missing something in the latest commit?

Looking forward to seeing your information on deployment, thanks again!

shaunymca commented 7 years ago

Hey @kqdtran, sorry about that. That commit would probably work, the newest (not the one you tried) commit should work also. I'll try and get the run it from Heroku readme section up this week.

Also, the .env file will not change, because it is in the .gitignore. You don't want your slack token available for all to see and neither do I. The .env is used by the dotenv module which makes developing with secrets easier. Your server, heroku or otherwise, will have to account for this in it's own way.