From 49fa5aa2a127bdf8924d02bf77e5086b39c7a447 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Wed, 3 Sep 2025 21:15:36 -0400 Subject: i vibe coded it --- server/src/jchat_http_404.erl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/src/jchat_http_404.erl (limited to 'server/src/jchat_http_404.erl') diff --git a/server/src/jchat_http_404.erl b/server/src/jchat_http_404.erl new file mode 100644 index 0000000..03f29cf --- /dev/null +++ b/server/src/jchat_http_404.erl @@ -0,0 +1,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}. -- cgit v1.2.3