Packages

Fast. Reusable. Quenya framework helps you generate and build OpenAPIv3 compatible API apps easily from a spec. It greatly reduced the time to build APIs from ideation to production.

Current section

Files

Jump to
quenya lib plugs match_all_plug.ex
Raw

lib/plugs/match_all_plug.ex

defmodule Quenya.Plug.MathAllPlug do
@moduledoc """
Plug for match all unknown path
Example:
# in your router file
match _, to: Quenya.Plug.MathAllPlug, init_opts: []
"""
import Plug.Conn
@behaviour Plug
@spec init(keyword()) :: keyword()
def init(opts) do
opts
end
@spec call(Plug.Conn.t(), keyword()) :: Plug.Conn.t()
def call(conn, _opts) do
send_resp(conn, 404, "requested path #{conn.request_path} not found")
end
end