mirror of
https://github.com/edgurgel/httparrot
synced 2025-04-06 00:32:34 -04:00
17 lines
358 B
Elixir
17 lines
358 B
Elixir
defmodule HTTParrot.RobotsHandler do
|
|
@moduledoc """
|
|
Returns a robots.txt.
|
|
"""
|
|
use HTTParrot.Cowboy, methods: ~w(GET HEAD OPTIONS)
|
|
|
|
def content_types_provided(req, state) do
|
|
{[{{"text", "plain", []}, :get_text}], req, state}
|
|
end
|
|
|
|
@robots """
|
|
User-agent: *
|
|
Disallow: /deny
|
|
"""
|
|
|
|
def get_text(req, state), do: {@robots, req, state}
|
|
end
|