@forklaunch/express 0.7.8 → 0.7.9

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/lib/index.js CHANGED
@@ -195,23 +195,27 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
195
195
  const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
196
196
  const host = typeof args[1] === "string" ? args[1] : process.env.HOST ?? "localhost";
197
197
  const protocol = process.env.PROTOCOL ?? "http";
198
+ const openApiServerUrls = (0, import_common3.getEnvVar)("DOCS_SERVER_URLS")?.split(",") ?? [
199
+ `${protocol}://${host}:${port}`
200
+ ];
201
+ const openApiServerDescriptions = (0, import_common3.getEnvVar)(
202
+ "DOCS_SERVER_DESCRIPTIONS"
203
+ )?.split(",") ?? ["Main Server"];
198
204
  const openApi = (0, import_http3.generateOpenApiSpecs)(
199
205
  this.schemaValidator,
200
- protocol,
201
- host,
202
- port,
203
- this.routers
206
+ openApiServerUrls,
207
+ openApiServerDescriptions,
208
+ this
204
209
  );
205
210
  if (this.schemaValidator instanceof import_zod.ZodSchemaValidator) {
206
211
  const zodSchemaValidator = this.schemaValidator;
207
- const routers = this.routers;
208
212
  const mcpServer = (0, import_http3.generateMcpServer)(
209
213
  zodSchemaValidator,
210
214
  protocol,
211
215
  host,
212
216
  port,
213
217
  "1.0.0",
214
- routers
218
+ this
215
219
  );
216
220
  mcpServer.start({
217
221
  httpStream: {
@@ -268,6 +272,9 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
268
272
  res.send(hash);
269
273
  }
270
274
  );
275
+ this.internal.get("/health", (_, res) => {
276
+ res.send("OK");
277
+ });
271
278
  const errorHandler = (err, req, res, _next) => {
272
279
  const statusCode = Number(res.statusCode);
273
280
  res.locals.errorMessage = err.message;
package/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/expressApplication.ts
2
- import { safeStringify as safeStringify2 } from "@forklaunch/common";
2
+ import { getEnvVar, safeStringify as safeStringify2 } from "@forklaunch/common";
3
3
  import {
4
4
  ATTR_HTTP_RESPONSE_STATUS_CODE,
5
5
  ForklaunchExpressLikeApplication,
@@ -167,23 +167,27 @@ var Application = class extends ForklaunchExpressLikeApplication {
167
167
  const port = typeof args[0] === "number" ? args[0] : Number(process.env.PORT);
168
168
  const host = typeof args[1] === "string" ? args[1] : process.env.HOST ?? "localhost";
169
169
  const protocol = process.env.PROTOCOL ?? "http";
170
+ const openApiServerUrls = getEnvVar("DOCS_SERVER_URLS")?.split(",") ?? [
171
+ `${protocol}://${host}:${port}`
172
+ ];
173
+ const openApiServerDescriptions = getEnvVar(
174
+ "DOCS_SERVER_DESCRIPTIONS"
175
+ )?.split(",") ?? ["Main Server"];
170
176
  const openApi = generateOpenApiSpecs(
171
177
  this.schemaValidator,
172
- protocol,
173
- host,
174
- port,
175
- this.routers
178
+ openApiServerUrls,
179
+ openApiServerDescriptions,
180
+ this
176
181
  );
177
182
  if (this.schemaValidator instanceof ZodSchemaValidator) {
178
183
  const zodSchemaValidator = this.schemaValidator;
179
- const routers = this.routers;
180
184
  const mcpServer = generateMcpServer(
181
185
  zodSchemaValidator,
182
186
  protocol,
183
187
  host,
184
188
  port,
185
189
  "1.0.0",
186
- routers
190
+ this
187
191
  );
188
192
  mcpServer.start({
189
193
  httpStream: {
@@ -240,6 +244,9 @@ var Application = class extends ForklaunchExpressLikeApplication {
240
244
  res.send(hash);
241
245
  }
242
246
  );
247
+ this.internal.get("/health", (_, res) => {
248
+ res.send("OK");
249
+ });
243
250
  const errorHandler = (err, req, res, _next) => {
244
251
  const statusCode = Number(res.statusCode);
245
252
  res.locals.errorMessage = err.message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/express",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "Forklaunch framework for express.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -37,7 +37,7 @@
37
37
  "qs": "^6.14.0",
38
38
  "swagger-ui-express": "^5.0.1",
39
39
  "@forklaunch/common": "0.4.6",
40
- "@forklaunch/core": "0.12.0",
40
+ "@forklaunch/core": "0.12.1",
41
41
  "@forklaunch/validator": "0.8.0"
42
42
  },
43
43
  "devDependencies": {