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

add index option to static plug #527

Closed
wants to merge 1 commit into from

Conversation

jackxxu
Copy link

@jackxxu jackxxu commented Mar 12, 2017

Many times, when we need to make a directory of static content available via a http server, it is beneficial to configure a "default" content to be rendered when the root url is requested.

Similar configuration exists in other similar frameworks, such as Rack.

@sourcelevel-bot
Copy link

Hello, @jackxxu! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

@sourcelevel-bot
Copy link

Ebert has finished reviewing this Pull Request and has found:

  • 1 possible new issue (including those that may have been commented here).

You can see more details about this review at https://ebertapp.io/github/elixir-lang/plug/pulls/527.

when meth in @allowed_methods do
segments = subset(at, conn.path_info)
|> index_on_root(index)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a function call when a pipeline is only one function long

@josevalim
Copy link
Member

Hi @jackxxu. We don't plan to support index lookup on static. If that is something you find necessary, you can write a plug that matches on the static prefix and rewrites the URLs accordingly. Thank you.

@josevalim josevalim closed this Mar 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants