aboutsummaryrefslogtreecommitdiff
path: root/server/src/jchat_http_404.erl
blob: 03f29cf6d0c883f1f2152dafb8df225161a223b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-module(jchat_http_404).

-export([init/2]).

init(Req0, State) ->
    Req1 = cowboy_req:reply(404, #{
        <<"content-type">> => <<"application/json; charset=utf-8">>,
        <<"access-control-allow-origin">> => <<"*">>
    }, jsx:encode(#{
        <<"error">> => <<"not_found">>,
        <<"message">> => <<"Endpoint not found">>,
        <<"suggestion">> => <<"Use web.jchat.localhost for the web interface">>
    }), Req0),
    {ok, Req1, State}.