mandubian / play-autosource

Play Autosource : 1mn REST/Crud/Async/Typesafe Datasource for Play Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to deploy to heroku

loicknuchel opened this issue · comments

I'm not sure this is the best place to ask but I give a try. Tell me if it's not.

I follow this tutorial and I wanted to deploy the result on heroku but it doesn't work :(
I don't know how to configure the mongoDB url with a dynamic variable. In this tutorial, we configure it in the conf/application.conf with mongodb.uri ="mongodb://localhost:27017/persons". But in heroku, mongoDB url is given with the variable $MONGOLAB_URI...

Anybody has an idea on how to get things work ?

Thanks

Have you tried to simply use ?
mongodb.uri=${MONGOLAB_URI}

Great it works !!! \o/
Thanks a lot !

Second question, do you have an idea on how to get things work both on local and on heroku ?

Maybe you can include a local.conf in your application.conf below the declaration mongodb.uri=${MONGOLAB_URI}

and in this local.conf, you override mongodb.uri=...

And naturally you don't push this file to github :)
I'm not sure it will work but you can try it!

Nce try, it works !

Thanks a lot.

In your Procfile, you can add an argument with -Dmongodb.uri=$MONGOLAB_URI

@ojacquemart Thank you, it's a little better. :)