Reputation: 43
I want to run my development server under custom domain and subdomain, ex.: https://api.custom.local/
. In Rails
I would use puma-dev
, is there an equivalent of this tool in Phoenix
?
Upvotes: 1
Views: 212
Reputation: 43
I've followed Justin answer and made a little research on puma-dev
.
We can use puma-dev
as reverse proxy for Phoenix app.
Follow puma-dev
README in order to install it.
url: [
sheme: "https",
host: "api.custom.test"
],
https: [
port: 443,
cipher_suite: :strong,
keyfile: System.get_env("SSL_KEYFILE_PATH"),
certfile: System.get_env("SSL_CERTFILE_PATH")
]
We can access https://api.custom.test
puma-dev
allows to add custom domains by executing puma-dev -install -d local
Upvotes: 0
Reputation: 10041
Edit your config/dev.exs
file. Chave the configuration of MyApp.Endpoint
. You will want to add or edit the :url
key. You can do something like the following
url: [host: "api.custom.local", port: 4000]
Then you can just start your application as your normally would.
Upvotes: 1