1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-06 00:32:34 -04:00
httparrot/lib/httparrot/robots_handler.ex
2014-07-22 20:33:22 +12:00

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