@cedarjs/api-server 5.0.0-canary.2439 → 5.0.0-canary.2443

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/dist/bin.js CHANGED
@@ -20,6 +20,9 @@ function getAPIHost() {
20
20
  function getAPIPort() {
21
21
  return process.env.REDWOOD_API_PORT ? parseInt(process.env.REDWOOD_API_PORT) : getConfig().api.port;
22
22
  }
23
+ function getAPIRootPath() {
24
+ return process.env.CEDAR_API_ROOT_PATH ?? "/";
25
+ }
23
26
  function getWebHost() {
24
27
  let host = process.env.REDWOOD_WEB_HOST;
25
28
  host ??= getConfig().web.host;
@@ -107,7 +110,7 @@ var init_createServerHelpers = __esm({
107
110
  "use strict";
108
111
  init_cliHelpers();
109
112
  getDefaultCreateServerOptions = () => ({
110
- apiRootPath: "/",
113
+ apiRootPath: getAPIRootPath(),
111
114
  logger: {
112
115
  level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === "development" ? "debug" : "warn")
113
116
  },
package/dist/cjs/bin.js CHANGED
@@ -40,6 +40,9 @@ function getAPIHost() {
40
40
  function getAPIPort() {
41
41
  return process.env.REDWOOD_API_PORT ? parseInt(process.env.REDWOOD_API_PORT) : (0, import_project_config.getConfig)().api.port;
42
42
  }
43
+ function getAPIRootPath() {
44
+ return process.env.CEDAR_API_ROOT_PATH ?? "/";
45
+ }
43
46
  function getWebHost() {
44
47
  let host = process.env.REDWOOD_WEB_HOST;
45
48
  host ??= (0, import_project_config.getConfig)().web.host;
@@ -129,7 +132,7 @@ var init_createServerHelpers = __esm({
129
132
  import_helpers = require("@cedarjs/fastify-web/dist/helpers.js");
130
133
  init_cliHelpers();
131
134
  getDefaultCreateServerOptions = () => ({
132
- apiRootPath: "/",
135
+ apiRootPath: getAPIRootPath(),
133
136
  logger: {
134
137
  level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === "development" ? "debug" : "warn")
135
138
  },
@@ -1,5 +1,6 @@
1
1
  export declare function getAPIHost(): string;
2
2
  export declare function getAPIPort(): number;
3
+ export declare function getAPIRootPath(): string;
3
4
  export declare function getWebHost(): string;
4
5
  export declare function getWebPort(): number;
5
6
  //# sourceMappingURL=cliHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB;AAED,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB"}
1
+ {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB;AAED,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB"}
@@ -20,6 +20,7 @@ var cliHelpers_exports = {};
20
20
  __export(cliHelpers_exports, {
21
21
  getAPIHost: () => getAPIHost,
22
22
  getAPIPort: () => getAPIPort,
23
+ getAPIRootPath: () => getAPIRootPath,
23
24
  getWebHost: () => getWebHost,
24
25
  getWebPort: () => getWebPort
25
26
  });
@@ -34,6 +35,9 @@ function getAPIHost() {
34
35
  function getAPIPort() {
35
36
  return process.env.REDWOOD_API_PORT ? parseInt(process.env.REDWOOD_API_PORT) : (0, import_project_config.getConfig)().api.port;
36
37
  }
38
+ function getAPIRootPath() {
39
+ return process.env.CEDAR_API_ROOT_PATH ?? "/";
40
+ }
37
41
  function getWebHost() {
38
42
  let host = process.env.REDWOOD_WEB_HOST;
39
43
  host ??= (0, import_project_config.getConfig)().web.host;
@@ -47,6 +51,7 @@ function getWebPort() {
47
51
  0 && (module.exports = {
48
52
  getAPIHost,
49
53
  getAPIPort,
54
+ getAPIRootPath,
50
55
  getWebHost,
51
56
  getWebPort
52
57
  });
@@ -26,7 +26,7 @@ var import_util = require("util");
26
26
  var import_helpers = require("@cedarjs/fastify-web/dist/helpers.js");
27
27
  var import_cliHelpers = require("./cliHelpers.js");
28
28
  const getDefaultCreateServerOptions = () => ({
29
- apiRootPath: "/",
29
+ apiRootPath: (0, import_cliHelpers.getAPIRootPath)(),
30
30
  logger: {
31
31
  level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === "development" ? "debug" : "warn")
32
32
  },
@@ -1,5 +1,6 @@
1
1
  export declare function getAPIHost(): string;
2
2
  export declare function getAPIPort(): number;
3
+ export declare function getAPIRootPath(): string;
3
4
  export declare function getWebHost(): string;
4
5
  export declare function getWebPort(): number;
5
6
  //# sourceMappingURL=cliHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB;AAED,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB"}
1
+ {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB;AAED,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,UAAU,WAIzB"}
@@ -8,6 +8,9 @@ function getAPIHost() {
8
8
  function getAPIPort() {
9
9
  return process.env.REDWOOD_API_PORT ? parseInt(process.env.REDWOOD_API_PORT) : getConfig().api.port;
10
10
  }
11
+ function getAPIRootPath() {
12
+ return process.env.CEDAR_API_ROOT_PATH ?? "/";
13
+ }
11
14
  function getWebHost() {
12
15
  let host = process.env.REDWOOD_WEB_HOST;
13
16
  host ??= getConfig().web.host;
@@ -20,6 +23,7 @@ function getWebPort() {
20
23
  export {
21
24
  getAPIHost,
22
25
  getAPIPort,
26
+ getAPIRootPath,
23
27
  getWebHost,
24
28
  getWebPort
25
29
  };
@@ -1,8 +1,8 @@
1
1
  import { parseArgs } from "util";
2
2
  import { coerceRootPath } from "@cedarjs/fastify-web/dist/helpers.js";
3
- import { getAPIHost, getAPIPort } from "./cliHelpers.js";
3
+ import { getAPIHost, getAPIPort, getAPIRootPath } from "./cliHelpers.js";
4
4
  const getDefaultCreateServerOptions = () => ({
5
- apiRootPath: "/",
5
+ apiRootPath: getAPIRootPath(),
6
6
  logger: {
7
7
  level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === "development" ? "debug" : "warn")
8
8
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "5.0.0-canary.2439",
3
+ "version": "5.0.0-canary.2443",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -133,11 +133,11 @@
133
133
  "test:watch": "vitest watch"
134
134
  },
135
135
  "dependencies": {
136
- "@cedarjs/context": "5.0.0-canary.2439",
137
- "@cedarjs/fastify-web": "5.0.0-canary.2439",
138
- "@cedarjs/internal": "5.0.0-canary.2439",
139
- "@cedarjs/project-config": "5.0.0-canary.2439",
140
- "@cedarjs/web-server": "5.0.0-canary.2439",
136
+ "@cedarjs/context": "5.0.0-canary.2443",
137
+ "@cedarjs/fastify-web": "5.0.0-canary.2443",
138
+ "@cedarjs/internal": "5.0.0-canary.2443",
139
+ "@cedarjs/project-config": "5.0.0-canary.2443",
140
+ "@cedarjs/web-server": "5.0.0-canary.2443",
141
141
  "@fastify/multipart": "9.4.0",
142
142
  "@fastify/url-data": "6.0.3",
143
143
  "ansis": "4.2.0",
@@ -155,12 +155,12 @@
155
155
  "yargs": "17.7.2"
156
156
  },
157
157
  "devDependencies": {
158
- "@cedarjs/framework-tools": "5.0.0-canary.2439",
158
+ "@cedarjs/framework-tools": "5.0.0-canary.2443",
159
159
  "@types/aws-lambda": "8.10.161",
160
160
  "@types/dotenv-defaults": "^5.0.0",
161
161
  "@types/split2": "4.2.3",
162
162
  "@types/yargs": "17.0.35",
163
- "graphql-yoga": "5.21.0",
163
+ "graphql-yoga": "5.21.1",
164
164
  "memfs": "4.57.6",
165
165
  "pino-abstract-transport": "1.2.0",
166
166
  "tsx": "4.21.0",