@emseepea/create-openapi-backed-server 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/initializer-dist/template/.dockerignore +17 -0
- package/initializer-dist/template/Dockerfile +19 -0
- package/initializer-dist/template/README.md +18 -0
- package/initializer-dist/template/package.json +5 -4
- package/initializer-dist/template/src/server.ts +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -68,6 +68,24 @@ npm start
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
The MCP endpoint is `http://127.0.0.1:3000/mcp`.
|
|
71
|
+
`PETSTORE_API_ORIGIN` can select an operator-controlled compatible endpoint;
|
|
72
|
+
when it is unset, the server uses Swagger Petstore.
|
|
73
|
+
|
|
74
|
+
## Build a production container
|
|
75
|
+
|
|
76
|
+
Run `npm install` first so the project has a lockfile. Then run:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
npm run container:build
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The image is for a production deployment behind a trusted proxy. It starts with
|
|
83
|
+
the fail-closed production profile and needs a runtime-mounted deployment
|
|
84
|
+
configuration file. Keep secrets in your platform's runtime secret store, not in
|
|
85
|
+
the Dockerfile, build arguments, or deployment configuration file.
|
|
86
|
+
|
|
87
|
+
For the production proxy, runtime configuration, and hardening requirements, see
|
|
88
|
+
the [container guide](https://emseepea.github.io/emseepea/examples/#build-a-production-container).
|
|
71
89
|
|
|
72
90
|
## Choose Open or Protected Access
|
|
73
91
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
FROM docker.io/library/node:24.21.0-trixie-slim@sha256:db3ae80f5d8df06e04dabdf7b44cbf008d32de168205fa0294444aabbc08c590 AS build
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY . .
|
|
4
|
+
RUN test "$(node --version)" = "v24.21.0" \
|
|
5
|
+
&& test -f package-lock.json \
|
|
6
|
+
&& npm ci --ignore-scripts \
|
|
7
|
+
&& npm run build \
|
|
8
|
+
&& npm prune --omit=dev --ignore-scripts
|
|
9
|
+
|
|
10
|
+
FROM gcr.io/distroless/nodejs24-debian13:nonroot@sha256:7781e8b4fccf59240bd539af6738cccf8dad4be303165c3a1fa065c48699b937
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
ENV EMSEEPEA_DEPLOYMENT_MODE=production-behind-proxy
|
|
13
|
+
COPY --from=build --chown=65532:65532 /app/package.json ./package.json
|
|
14
|
+
COPY --from=build --chown=65532:65532 /app/node_modules ./node_modules
|
|
15
|
+
COPY --from=build --chown=65532:65532 /app/dist ./dist
|
|
16
|
+
USER 65532:65532
|
|
17
|
+
EXPOSE 3000
|
|
18
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD ["/nodejs/bin/node", "-e", "const port=process.env.PORT||'3000';fetch(`http://127.0.0.1:${port}/healthz`).then((r)=>process.exit(r.ok?0:1),()=>process.exit(1));"]
|
|
19
|
+
CMD ["dist/server.js"]
|
|
@@ -49,6 +49,24 @@ npm start
|
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
The MCP endpoint is `http://127.0.0.1:3000/mcp`.
|
|
52
|
+
`PETSTORE_API_ORIGIN` can select an operator-controlled compatible endpoint;
|
|
53
|
+
when it is unset, the server uses Swagger Petstore.
|
|
54
|
+
|
|
55
|
+
## Build a production container
|
|
56
|
+
|
|
57
|
+
Run `npm install` first so the project has a lockfile. Then run:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npm run container:build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The image is for a production deployment behind a trusted proxy. It starts with
|
|
64
|
+
the fail-closed production profile and needs a runtime-mounted deployment
|
|
65
|
+
configuration file. Keep secrets in your platform's runtime secret store, not in
|
|
66
|
+
the Dockerfile, build arguments, or deployment configuration file.
|
|
67
|
+
|
|
68
|
+
For the production proxy, runtime configuration, and hardening requirements, see
|
|
69
|
+
the [container guide](https://emseepea.github.io/emseepea/examples/#build-a-production-container).
|
|
52
70
|
|
|
53
71
|
## Choose Open or Protected Access
|
|
54
72
|
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
"test:llm": "npm run build && npm run test:llm:built",
|
|
15
15
|
"test:llm:built": "emseepea-test eval",
|
|
16
16
|
"lint": "oxlint src test eval scripts test-support",
|
|
17
|
-
"license:check": "node scripts/check-licenses.mjs"
|
|
17
|
+
"license:check": "node scripts/check-licenses.mjs",
|
|
18
|
+
"container:build": "docker build --tag emseepea-server:local ."
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@emseepea/feedback": "0.2.
|
|
21
|
+
"@emseepea/feedback": "0.2.6",
|
|
21
22
|
"@scalar/openapi-upgrader": "0.2.15",
|
|
22
|
-
"@emseepea/testing": "0.9.
|
|
23
|
+
"@emseepea/testing": "0.9.9",
|
|
23
24
|
"@modelcontextprotocol/client": "2.0.0",
|
|
24
25
|
"@types/node": "24.13.3",
|
|
25
26
|
"oxlint": "1.80.0",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
},
|
|
33
34
|
"private": true,
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@emseepea/server": "0.
|
|
36
|
+
"@emseepea/server": "0.10.0",
|
|
36
37
|
"zod": "4.4.3"
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { serveEmseepea } from "@emseepea/server";
|
|
1
|
+
import { loadDeploymentProfile, serveEmseepea } from "@emseepea/server";
|
|
2
2
|
import { createJsonHttpClient } from "@emseepea/server/http";
|
|
3
3
|
import { createBackendExample } from "./app.js";
|
|
4
4
|
|
|
5
5
|
const client = createJsonHttpClient({
|
|
6
|
-
origin: "https://petstore3.swagger.io",
|
|
6
|
+
origin: process.env.PETSTORE_API_ORIGIN ?? "https://petstore3.swagger.io",
|
|
7
7
|
maxResponseBytes: 128 * 1024,
|
|
8
8
|
});
|
|
9
9
|
const running = await serveEmseepea(
|
|
10
|
-
await createBackendExample(client),
|
|
10
|
+
await createBackendExample(client, { deployment: loadDeploymentProfile() }),
|
|
11
11
|
{ port: Number.parseInt(process.env.PORT ?? "3000", 10) },
|
|
12
12
|
);
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-openapi-backed-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Create an Em See Pea server backed by an OpenAPI-described web API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"prepack": "npm run build:initializer"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@emseepea/feedback": "0.2.
|
|
25
|
-
"@emseepea/server": "0.
|
|
24
|
+
"@emseepea/feedback": "0.2.6",
|
|
25
|
+
"@emseepea/server": "0.10.0",
|
|
26
26
|
"@scalar/openapi-upgrader": "0.2.15",
|
|
27
|
-
"@emseepea/testing": "0.9.
|
|
27
|
+
"@emseepea/testing": "0.9.9",
|
|
28
28
|
"@modelcontextprotocol/client": "2.0.0",
|
|
29
29
|
"@types/node": "24.13.3",
|
|
30
30
|
"oxlint": "1.80.0",
|