atproto pds in zig pds.zat.dev
pds atproto
25

Configure Feed

Select the types of activity you want to include in your feed.

Add ASCII homepage

zzstoatzz (May 21, 2026, 10:06 AM -0500) f8703eb4 1af52b12

+32 -2
+15
src/http/api.zig
··· 140 140 }); 141 141 } 142 142 143 + pub fn text(request: *http.Server.Request, status: http.Status, body: []const u8) !void { 144 + normalizeBodylessRequest(request); 145 + try request.respond(body, .{ 146 + .status = status, 147 + .extra_headers = &text_headers, 148 + }); 149 + } 150 + 143 151 pub fn xrpcError( 144 152 request: *http.Server.Request, 145 153 status: http.Status, ··· 153 161 154 162 const json_headers = [_]http.Header{ 155 163 .{ .name = "content-type", .value = "application/json; charset=utf-8" }, 164 + .{ .name = "access-control-allow-origin", .value = "*" }, 165 + .{ .name = "access-control-allow-private-network", .value = "true" }, 166 + .{ .name = "connection", .value = "close" }, 167 + }; 168 + 169 + const text_headers = [_]http.Header{ 170 + .{ .name = "content-type", .value = "text/plain; charset=utf-8" }, 156 171 .{ .name = "access-control-allow-origin", .value = "*" }, 157 172 .{ .name = "access-control-allow-private-network", .value = "true" }, 158 173 .{ .name = "connection", .value = "close" },
+17 -2
src/http/server.zig
··· 12 12 const authenticatedEmpty = http_api.authenticatedEmpty; 13 13 const corsPreflight = http_api.corsPreflight; 14 14 const json = http_api.json; 15 + const text = http_api.text; 15 16 const xrpcError = http_api.xrpcError; 16 17 17 18 pub const Options = struct { ··· 60 61 fn serveRequest(request: *http.Server.Request) !void { 61 62 switch (router.route(request.head.method, request.head.target)) { 62 63 .cors_preflight => try corsPreflight(request), 63 - .root => try json(request, .ok, 64 - \\{"name":"zds","version":"0.0.0","links":{"health":"/xrpc/_health","describeServer":"/xrpc/com.atproto.server.describeServer"}} 64 + .root => try text(request, .ok, 65 + \\ __ 66 + \\ ____ ____/ /____ 67 + \\/_ / / __ / ___/ 68 + \\ / /_/ /_/ (__ ) 69 + \\/___/\__,_/____/ 70 + \\ 71 + \\zds is an at protocol personal data server. 72 + \\ 73 + \\most api routes are under /xrpc/ 74 + \\ 75 + \\code: https://tangled.org/zzstoatzz.io/zds 76 + \\protocol: https://atproto.com 77 + \\health: /xrpc/_health 78 + \\server: /xrpc/com.atproto.server.describeServer 79 + \\ 65 80 ), 66 81 .health => try json(request, .ok, 67 82 \\{"version":"0.0.0","status":"ok"}