+2
Cargo.lock
+2
Cargo.lock
+1
-1
slingshot/Cargo.toml
+1
-1
slingshot/Cargo.toml
···
17
log = "0.4.27"
18
metrics = "0.24.2"
19
metrics-exporter-prometheus = { version = "0.17.1", features = ["http-listener"] }
20
-
poem = { version = "3.1.12", features = ["acme"] }
21
poem-openapi = { version = "5.1.16", features = ["scalar"] }
22
reqwest = { version = "0.12.22", features = ["json"] }
23
rustls = "0.23.31"
···
17
log = "0.4.27"
18
metrics = "0.24.2"
19
metrics-exporter-prometheus = { version = "0.17.1", features = ["http-listener"] }
20
+
poem = { version = "3.1.12", features = ["acme", "static-files"] }
21
poem-openapi = { version = "5.1.16", features = ["scalar"] }
22
reqwest = { version = "0.12.22", features = ["json"] }
23
rustls = "0.23.31"
+3
-3
slingshot/src/server.rs
+3
-3
slingshot/src/server.rs
···
13
14
use poem::{
15
Endpoint, EndpointExt, Route, Server,
16
-
endpoint::make_sync,
17
http::Method,
18
listener::{
19
Listener, TcpListener,
···
712
));
713
714
let mut app = Route::new()
715
-
.nest("/", api_service.scalar())
716
-
.nest("/openapi.json", api_service.spec_endpoint())
717
.nest("/xrpc/", api_service);
718
719
if let Some(host) = host {
···
13
14
use poem::{
15
Endpoint, EndpointExt, Route, Server,
16
+
endpoint::{StaticFileEndpoint, make_sync},
17
http::Method,
18
listener::{
19
Listener, TcpListener,
···
712
));
713
714
let mut app = Route::new()
715
+
.at("/", StaticFileEndpoint::new("./static/index.html"))
716
+
.nest("/openapi", api_service.spec_endpoint())
717
.nest("/xrpc/", api_service);
718
719
if let Some(host) = host {
+53
slingshot/static/index.html
+53
slingshot/static/index.html
···
···
1
+
<!doctype html>
2
+
<html lang="en">
3
+
<head>
4
+
<meta charset="utf-8" />
5
+
<title>Slingshot: atproto edge record cache</title>
6
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
<meta name="description" content="API Documentation for Slingshot, a firehose-listening atproto edge record and identity cache." />
8
+
<style>
9
+
.custom-header {
10
+
height: 42px;
11
+
background-color: #221828;
12
+
box-shadow: inset 0 -1px 0 var(--scalar-border-color);
13
+
color: var(--scalar-color-1);
14
+
font-size: var(--scalar-font-size-3);
15
+
font-family: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
16
+
padding: 0 18px;
17
+
justify-content: space-between;
18
+
}
19
+
.custom-header,
20
+
.custom-header nav {
21
+
display: flex;
22
+
align-items: center;
23
+
gap: 18px;
24
+
}
25
+
.custom-header a:hover {
26
+
color: var(--scalar-color-2);
27
+
}
28
+
</style>
29
+
</head>
30
+
<body>
31
+
<header class="custom-header scalar-app">
32
+
<p>
33
+
TODO: thing
34
+
</p>
35
+
<nav>
36
+
<b>a <a href="https://microcosm.blue">microcosm</a> project</b>
37
+
<a href="https://bsky.app/profile/microcosm.blue">@microcosm.blue</a>
38
+
<a href="https://github.com/at-microcosm">github</a>
39
+
</nav>
40
+
</header>
41
+
42
+
<script id="api-reference" type="application/json" data-url="/openapi"></script>
43
+
44
+
<script>
45
+
var configuration = {
46
+
theme: 'purple',
47
+
}
48
+
document.getElementById('api-reference').dataset.configuration = JSON.stringify(configuration)
49
+
</script>
50
+
51
+
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
52
+
</body>
53
+
</html>