tangled
alpha
login
or
join now
jauntywk.bsky.social
/
margin
forked from
margin.at/margin
0
fork
atom
Write on the margins of the internet. Powered by the AT Protocol.
0
fork
atom
overview
issues
pulls
pipelines
fix
scanash.com
1 month ago
1cfc158f
450802c6
+6
-3
2 changed files
expand all
collapse all
unified
split
web
astro.config.mjs
src
middleware.ts
+4
-2
web/astro.config.mjs
···
4
4
import tailwind from "@astrojs/tailwind";
5
5
import node from "@astrojs/node";
6
6
7
7
+
const API_PORT = process.env.API_PORT || 8081;
8
8
+
7
9
// https://astro.build/config
8
10
export default defineConfig({
9
11
adapter: node({ mode: "standalone" }),
···
19
21
server: {
20
22
proxy: {
21
23
"/api": {
22
22
-
target: "http://localhost:8080",
24
24
+
target: `http://localhost:${API_PORT}`,
23
25
changeOrigin: true,
24
26
},
25
27
"/auth": {
26
26
-
target: "http://localhost:8080",
28
28
+
target: `http://localhost:${API_PORT}`,
27
29
changeOrigin: true,
28
30
},
29
31
},
+2
-1
web/src/middleware.ts
···
1
1
import type { APIContext } from "astro";
2
2
3
3
-
const API_URL = process.env.API_URL || "http://localhost:8081";
3
3
+
const API_PORT = process.env.API_PORT || 8081;
4
4
+
const API_URL = process.env.API_URL || `http://localhost:${API_PORT}`;
4
5
5
6
const PROXY_PATHS = ["/api/", "/auth/", "/client-metadata.json", "/jwks.json"];
6
7