-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}.