GraziePrego commited on
Commit
e553fa4
·
verified ·
1 Parent(s): 2c3f2c8

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. Dockerfile +2 -2
  2. build_logs3.txt +0 -0
  3. patch_app.py +30 -0
  4. server/src/app.ts +18 -0
Dockerfile CHANGED
@@ -64,7 +64,7 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
64
  ENV NODE_ENV=production \
65
  HOME=/paperclip \
66
  HOST=0.0.0.0 \
67
- PORT=3100 \
68
  SERVE_UI=true \
69
  PAPERCLIP_HOME=/paperclip \
70
  PAPERCLIP_INSTANCE_ID=default \
@@ -76,7 +76,7 @@ ENV NODE_ENV=production \
76
  OPENCODE_ALLOW_ALL_MODELS=true
77
 
78
  VOLUME ["/paperclip"]
79
- EXPOSE 3100
80
 
81
  ENTRYPOINT ["docker-entrypoint.sh"]
82
  CMD ["node", "--import", "./server/node_modules/tsx/dist/loader.mjs", "server/dist/index.js"]
 
64
  ENV NODE_ENV=production \
65
  HOME=/paperclip \
66
  HOST=0.0.0.0 \
67
+ PORT=7860 \
68
  SERVE_UI=true \
69
  PAPERCLIP_HOME=/paperclip \
70
  PAPERCLIP_INSTANCE_ID=default \
 
76
  OPENCODE_ALLOW_ALL_MODELS=true
77
 
78
  VOLUME ["/paperclip"]
79
+ EXPOSE 7860
80
 
81
  ENTRYPOINT ["docker-entrypoint.sh"]
82
  CMD ["node", "--import", "./server/node_modules/tsx/dist/loader.mjs", "server/dist/index.js"]
build_logs3.txt ADDED
The diff for this file is too large to render. See raw diff
 
patch_app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+
3
+ with open("server/src/app.ts", "r") as f:
4
+ content = f.read()
5
+
6
+ replacement = """ api.use(boardMutationGuard());
7
+
8
+ api.get("/api-docs", (req, res) => {
9
+ res.json({
10
+ endpoints: [
11
+ {
12
+ method: "GET",
13
+ path: "/health",
14
+ purpose: "Returns HTTP 200 when the app is ready and provides health information."
15
+ },
16
+ {
17
+ method: "GET",
18
+ path: "/api-docs",
19
+ purpose: "Documents all available API endpoints."
20
+ }
21
+ ]
22
+ });
23
+ });
24
+
25
+ """
26
+
27
+ content = content.replace(" api.use(boardMutationGuard());\n", replacement)
28
+
29
+ with open("server/src/app.ts", "w") as f:
30
+ f.write(content)
server/src/app.ts CHANGED
@@ -140,6 +140,24 @@ export async function createApp(
140
  // Mount API routes
141
  const api = Router();
142
  api.use(boardMutationGuard());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  api.use(
144
  "/health",
145
  healthRoutes(db, {
 
140
  // Mount API routes
141
  const api = Router();
142
  api.use(boardMutationGuard());
143
+
144
+ api.get("/api-docs", (req, res) => {
145
+ res.json({
146
+ endpoints: [
147
+ {
148
+ method: "GET",
149
+ path: "/health",
150
+ purpose: "Returns HTTP 200 when the app is ready and provides health information."
151
+ },
152
+ {
153
+ method: "GET",
154
+ path: "/api-docs",
155
+ purpose: "Documents all available API endpoints."
156
+ }
157
+ ]
158
+ });
159
+ });
160
+
161
  api.use(
162
  "/health",
163
  healthRoutes(db, {