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 extension to easily create redirects #19

Merged
merged 1 commit into from
Jul 29, 2019
Merged

Conversation

waiting-for-dev
Copy link
Owner

If none is given, default status code is 302.

require 'web_pipe'

WebPipe.load_extensions(:redirect)

class MyApp
  include WebPipe

  plug(:redirect) do |conn|
    conn.redirect('/') # same as conn.redirect('/', 302)
  end
end

If none is given, default status code is 302.

```ruby
require 'web_pipe'

WebPipe.load_extensions(:redirect)

class MyApp
  include WebPipe

  plug(:redirect) do |conn|
    conn.redirect('/') # same as conn.redirect('/', 302)
  end
end
```
@waiting-for-dev waiting-for-dev added the enhancement New feature or request label Jul 29, 2019
@waiting-for-dev waiting-for-dev merged commit 1ed9c5a into master Jul 29, 2019
@waiting-for-dev waiting-for-dev deleted the redirect branch July 29, 2019 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant