Browse Source
allow the user to see something meaningful at /api/ path, rather than throwing an errortest/local-setup
2 changed files with 28 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||||||
|
defmodule GcIndexRelayWeb.ApiController do |
||||||
|
use GcIndexRelayWeb, :controller |
||||||
|
|
||||||
|
def index(conn, _params) do |
||||||
|
json(conn, %{ |
||||||
|
relay: "gc_index_relay", |
||||||
|
version: "0.1", |
||||||
|
endpoints: [ |
||||||
|
%{ |
||||||
|
method: "GET", |
||||||
|
path: "/api/events", |
||||||
|
description: "List events (requires filter params)" |
||||||
|
}, |
||||||
|
%{ |
||||||
|
method: "POST", |
||||||
|
path: "/api/events/filter", |
||||||
|
description: "Query events with a NIP-01 filter body" |
||||||
|
}, |
||||||
|
%{method: "GET", path: "/api/events/:id", description: "Get a single event by ID"}, |
||||||
|
%{method: "POST", path: "/api/events", description: "Publish a new event"}, |
||||||
|
%{method: "DELETE", path: "/api/events/:id", description: "Delete an event by ID"}, |
||||||
|
%{method: "GET", path: "/api/swagger", description: "Swagger UI"}, |
||||||
|
%{method: "GET", path: "/health", description: "Health check"} |
||||||
|
] |
||||||
|
}) |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue