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

How to configure the public folder? #559

Closed
nono opened this issue Feb 3, 2020 · 2 comments
Closed

How to configure the public folder? #559

nono opened this issue Feb 3, 2020 · 2 comments
Labels

Comments

@nono
Copy link

nono commented Feb 3, 2020

Description

I'd like to use a custom public folder and I don't see a good way to do that. As a work-around, I have recoded Kemal.run, but it looks very hackish.

Steps to Reproduce

Kemal.run do |config|
  config.public_folder = "./web"
end

Expected behavior: Kemal serves static files from the web directory

Actual behavior: Kemal serves static files from the public directory

Reproduces how often: always

Versions

$ crystal --version
Crystal 0.32.1 [41bd18fbe] (2019-12-18)

LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu

$ grep kemal -A1 shard.lock 
  kemal:
    github: kemalcr/kemal
    version: 0.26.1

Additional Information

config.setup is called before yield config in Kemal.run, which means that changing the config in the block has no effect on how the config setup its handlers.

@mamantoha
Copy link
Contributor

You can

Kemal.config.public_folder = "./web"
Kemal.run

@sdogruyol
Copy link
Member

As @mamantoha mentioned 👍

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

3 participants