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

deploy docs needed - how to specify port #360

Closed
tigernassau opened this issue Apr 29, 2017 · 4 comments
Closed

deploy docs needed - how to specify port #360

tigernassau opened this issue Apr 29, 2017 · 4 comments
Labels

Comments

@tigernassau
Copy link

nice work on kemal - we are switching from Sinatra

how to run kemal on a specific port ?
crystal myapp.cr -p 8000 => fail
Kemal.run -p 8000 => fail
maybe answer is to run websocket but need to figure out how to integrate with nginx reverse proxy

deploying does not seem to be addressed in any samples or docs

@sdogruyol
Copy link
Member

From CLI

Please build your app in release mode.

crystal build --release your_app.cr
./your_app -p 3000

In your code

Kemal.config.port = 3000

@s0kil
Copy link

s0kil commented Aug 22, 2018

This needs to be in docs: Kemal.config.port = 3000

@carcinocron
Copy link

This is probably preferred:

ENV["PORT"] ||= "3000"

Kemal.config.port = env["PORT"].to_i

@straight-shoota
Copy link
Contributor

Better: ENV["PORT"]?.try(&.to_i) || 3000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants