easy-cms 1.6.0 → 1.7.1
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 +1 -1
- package/dist/{chunk-3UI5QVNY.js → chunk-BKK4GU35.js} +8 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -32,7 +32,11 @@ import {
|
|
|
32
32
|
createEasyCMS,
|
|
33
33
|
createRestHandler
|
|
34
34
|
} from "@easy-cms/core";
|
|
35
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
createRootEndpointHandler,
|
|
37
|
+
forwardedClientIp,
|
|
38
|
+
healthResponse
|
|
39
|
+
} from "@easy-cms/core/internal";
|
|
36
40
|
function createStandaloneHandler(cms, options = {}) {
|
|
37
41
|
const config = cms.config;
|
|
38
42
|
const adminPath = `/${config.admin.path.replace(/^\/+|\/+$/g, "")}`;
|
|
@@ -49,8 +53,8 @@ function createStandaloneHandler(cms, options = {}) {
|
|
|
49
53
|
return api(request);
|
|
50
54
|
}
|
|
51
55
|
if (under(pathname, adminPath)) return admin(request);
|
|
52
|
-
if (pathname === "/healthz")
|
|
53
|
-
return
|
|
56
|
+
if (pathname === "/healthz" || pathname === "/readyz")
|
|
57
|
+
return healthResponse(pathname === "/healthz" ? "healthz" : "readyz", cms);
|
|
54
58
|
clientIps.set(request, clientIp);
|
|
55
59
|
const endpoint = await rootEndpoints(request);
|
|
56
60
|
if (endpoint) return endpoint;
|
|
@@ -275,7 +279,7 @@ for a cron job where no server process keeps running. Servers do this every minu
|
|
|
275
279
|
serve: `Usage: easy-cms serve [--port <n>] [--host <host>] [--watch] [--trust-proxy] [options]
|
|
276
280
|
|
|
277
281
|
Runs Easy CMS without Nuxt or Next.js: the admin at /admin, the REST API at /api/cms and
|
|
278
|
-
/healthz for load balancers. Frontends on other origins need \`cors\` in the config.
|
|
282
|
+
/healthz and /readyz for load balancers. Frontends on other origins need \`cors\` in the config.
|
|
279
283
|
|
|
280
284
|
--port <n> Port (default: PORT, then 4000)
|
|
281
285
|
--host <host> Interface to listen on (default: HOST, then all interfaces)
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface StandaloneOptions {
|
|
|
8
8
|
type Handler = (request: Request, clientIp?: string) => Promise<Response>;
|
|
9
9
|
/**
|
|
10
10
|
* One Web-standard handler for the whole standalone server: the REST API at `routes.api`, the
|
|
11
|
-
* admin at `admin.path`, `/healthz` for load balancers, and endpoints marked `root` (such as a
|
|
11
|
+
* admin at `admin.path`, `/healthz` and `/readyz` for load balancers, and endpoints marked `root` (such as a
|
|
12
12
|
* plugin's `/robots.txt`). `/` redirects to the admin.
|
|
13
13
|
*/
|
|
14
14
|
declare function createStandaloneHandler<C extends Config>(cms: EasyCMS<C>, options?: {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-cms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Command line tool for Easy CMS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"node": ">=22.12"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@easy-cms/core": "^1.
|
|
25
|
-
"@easy-cms/admin": "^1.
|
|
24
|
+
"@easy-cms/core": "^1.7.1",
|
|
25
|
+
"@easy-cms/admin": "^1.7.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@easy-cms/db-sqlite": "^1.
|
|
28
|
+
"@easy-cms/db-sqlite": "^1.7.1"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|