Plug_URL_Redirector v0.1.0 PlugUrlRedirector.Utils

This module provides the utility functions as Plug functions.

The functions in this module is derived from the module Phoenix.Controller in the Phoenix Framework, duplicated under the MIT license.

Summary

Functions

Sends redirect response to the given url

Functions

redirect(conn, opts)

Sends redirect response to the given url.

For security, :to only accepts paths. Use the :external option to redirect to any URL.

Examples

iex> redirect conn, to: "/login"

iex> redirect conn, external: "http://elixir-lang.org"