Hi, I am playing with ktor and I trying to deploy ...
# server
j
Hi, I am playing with ktor and I trying to deploy to google appengine using a uberJar. How can I pass my environment variable ( DATABASE_URL, …. ).
p
Use HCON configuration to define the relevant environment to config bindings. https://ktor.io/docs/configurations.html#environment-variables
j
I have already setup the env variable using ktor. I want to know how to use them in production appengine
a
1. Are you trying to set it as env var in app engine? 2. Retrieve it in ktor? 3. Use them to connect to DB? It is unclear what you are trying to do
j
@asad.awadia I have a small rest api connected to a local Postgres Sql database and I am using the ktor environments to set the database url, driver and all the necessary variable. The api works offline and I am using the appengine gradle plugin to deploy it GAE. I have a Postgres set up on Gcloud and I want to know how to connect the Gcloud database to my app after its deployed knowing that I am using an UberJar and my env variables are set using ktor.
a
The same way as you do it offline Ser the env vars to be of the gcloud postgres And that's it - all the other code should be the same