@mokup/server 1.2.0 → 1.2.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/index.cjs CHANGED
@@ -1,169 +1,17 @@
1
1
  'use strict';
2
2
 
3
+ const defineConfig$1 = require('@mokup/shared/define-config');
3
4
  const fetch = require('./fetch.cjs');
4
5
  const worker = require('./worker.cjs');
5
6
  require('@mokup/runtime');
6
- require('./shared/server.aaygIV2Q.cjs');
7
+ require('./shared/server.D0X6h49r.cjs');
7
8
 
8
- const middlewareSymbol = Symbol.for("mokup.config.middlewares");
9
- const contextStack = [];
10
- function getActiveContext() {
11
- const context = contextStack[contextStack.length - 1];
12
- if (!context) {
13
- throw new Error("onBeforeAll/onAfterAll must be called inside defineConfig()");
14
- }
15
- return context;
16
- }
17
- function runWithContext(context, fn) {
18
- contextStack.push(context);
19
- try {
20
- const result = fn();
21
- if (isPromise(result)) {
22
- return result.finally(() => {
23
- contextStack.pop();
24
- });
25
- }
26
- contextStack.pop();
27
- return result;
28
- } catch (error) {
29
- contextStack.pop();
30
- throw error;
31
- }
32
- }
33
- function isPromise(value) {
34
- return !!value && typeof value.then === "function";
35
- }
36
- function normalizeHookError(policy) {
37
- if (policy === "throw" || policy === "silent") {
38
- return policy;
39
- }
40
- return "warn";
41
- }
42
- function reportHookError(error, policy) {
43
- if (policy === "silent") {
44
- return;
45
- }
46
- if (policy === "warn") {
47
- console.warn("[@mokup/server] defineConfig hook failed:", error);
48
- }
49
- }
50
- function runHookSequence(stage, hooks, policy, setStage) {
51
- if (hooks.length === 0) {
52
- return;
53
- }
54
- setStage(stage);
55
- let chain = null;
56
- const runHook = (hook) => {
57
- try {
58
- const result = hook();
59
- if (isPromise(result)) {
60
- return result.catch((error) => {
61
- if (policy === "throw") {
62
- throw error;
63
- }
64
- reportHookError(error, policy);
65
- });
66
- }
67
- return void 0;
68
- } catch (error) {
69
- if (policy === "throw") {
70
- throw error;
71
- }
72
- reportHookError(error, policy);
73
- return void 0;
74
- }
75
- };
76
- for (const hook of hooks) {
77
- if (chain) {
78
- chain = chain.then(() => runHook(hook));
79
- continue;
80
- }
81
- const result = runHook(hook);
82
- if (isPromise(result)) {
83
- chain = result;
84
- }
85
- }
86
- if (!chain) {
87
- setStage("normal");
88
- return;
89
- }
90
- return chain.finally(() => {
91
- setStage("normal");
92
- });
93
- }
94
- function attachMetadata(config, meta) {
95
- Object.defineProperty(config, middlewareSymbol, {
96
- value: meta,
97
- enumerable: false
98
- });
99
- return config;
100
- }
101
- function normalizeConfig(value) {
102
- return value && typeof value === "object" ? value : {};
103
- }
104
- function onBeforeAll(handler) {
105
- if (typeof handler !== "function") {
106
- throw new TypeError("onBeforeAll expects a function");
107
- }
108
- const context = getActiveContext();
109
- context.hooks.pre.push(handler);
110
- }
111
- function onAfterAll(handler) {
112
- if (typeof handler !== "function") {
113
- throw new TypeError("onAfterAll expects a function");
114
- }
115
- const context = getActiveContext();
116
- context.hooks.post.push(handler);
117
- }
118
- function defineConfig(input) {
119
- if (typeof input === "function") {
120
- const pre = [];
121
- const normal = [];
122
- const post = [];
123
- let stage = "normal";
124
- const app = {
125
- use: (...handlers) => {
126
- if (stage === "pre") {
127
- pre.push(...handlers);
128
- return;
129
- }
130
- if (stage === "post") {
131
- post.push(...handlers);
132
- return;
133
- }
134
- normal.push(...handlers);
135
- }
136
- };
137
- const context = {
138
- app,
139
- hooks: { pre: [], post: [] },
140
- setStage: (next) => {
141
- stage = next;
142
- }
143
- };
144
- const result = runWithContext(context, () => input({ app }));
145
- const finalize = (value) => {
146
- const config2 = normalizeConfig(value);
147
- const policy = normalizeHookError(config2.hookError);
148
- const preResult = runHookSequence("pre", context.hooks.pre, policy, context.setStage);
149
- const runPost = () => runHookSequence("post", context.hooks.post, policy, context.setStage);
150
- if (isPromise(preResult)) {
151
- return preResult.then(runPost).then(() => attachMetadata(config2, { pre, normal, post }));
152
- }
153
- const postResult = runPost();
154
- if (isPromise(postResult)) {
155
- return postResult.then(() => attachMetadata(config2, { pre, normal, post }));
156
- }
157
- return attachMetadata(config2, { pre, normal, post });
158
- };
159
- if (isPromise(result)) {
160
- return result.then(finalize);
161
- }
162
- return finalize(result);
163
- }
164
- const config = normalizeConfig(input);
165
- return attachMetadata(config, { pre: [], normal: [], post: [] });
166
- }
9
+ const shared = defineConfig$1.createDefineConfig({
10
+ logPrefix: "[@mokup/server]"
11
+ });
12
+ const defineConfig = shared.defineConfig;
13
+ const onBeforeAll = shared.onBeforeAll;
14
+ const onAfterAll = shared.onAfterAll;
167
15
 
168
16
  exports.createFetchHandler = fetch.createFetchHandler;
169
17
  exports.createMokupWorker = worker.createMokupWorker;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
1
2
  import { R as RouteDirectoryConfig } from './shared/server.DLPB_I9q.cjs';
2
3
  export { H as HookErrorPolicy, M as MiddlewarePosition, a as MiddlewareRegistry, b as ResolvedMiddleware, c as RouteRule } from './shared/server.DLPB_I9q.cjs';
3
4
  import { MiddlewareHandler } from '@mokup/shared/hono';
@@ -7,46 +8,8 @@ export { F as FetchHandler, S as ServerOptions, W as WorkerBundle, a as WorkerIn
7
8
  export { createMokupWorker } from './worker.cjs';
8
9
  export { Manifest, ManifestRoute, ModuleMap, RuntimeOptions } from '@mokup/runtime';
9
10
 
10
- type HookHandler = () => void | Promise<void>;
11
- interface ConfigApp {
12
- use: (...handlers: MiddlewareHandler[]) => void;
13
- }
14
- type DefineConfigFactory = (context: {
15
- app: ConfigApp;
16
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
17
- declare function onBeforeAll(handler: HookHandler): void;
18
- declare function onAfterAll(handler: HookHandler): void;
19
- /**
20
- * Define a directory config with hook-based middleware registration.
21
- *
22
- * @param input - Config object or factory callback.
23
- * @returns Route directory config with middleware metadata.
24
- *
25
- * @example
26
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/server'
27
- *
28
- * export default defineConfig(({ app }) => {
29
- * onBeforeAll(() => {
30
- * app.use(async (c, next) => {
31
- * c.header('x-before', '1')
32
- * await next()
33
- * })
34
- * })
35
- *
36
- * app.use(async (_c, next) => {
37
- * await next()
38
- * })
39
- *
40
- * onAfterAll(() => {
41
- * app.use(async (c, next) => {
42
- * await next()
43
- * c.header('x-after', '1')
44
- * })
45
- * })
46
- *
47
- * return { delay: 120 }
48
- * })
49
- */
50
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
11
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
12
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
13
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
51
14
 
52
15
  export { RouteDirectoryConfig, defineConfig, onAfterAll, onBeforeAll };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
1
2
  import { R as RouteDirectoryConfig } from './shared/server.DLPB_I9q.mjs';
2
3
  export { H as HookErrorPolicy, M as MiddlewarePosition, a as MiddlewareRegistry, b as ResolvedMiddleware, c as RouteRule } from './shared/server.DLPB_I9q.mjs';
3
4
  import { MiddlewareHandler } from '@mokup/shared/hono';
@@ -7,46 +8,8 @@ export { F as FetchHandler, S as ServerOptions, W as WorkerBundle, a as WorkerIn
7
8
  export { createMokupWorker } from './worker.mjs';
8
9
  export { Manifest, ManifestRoute, ModuleMap, RuntimeOptions } from '@mokup/runtime';
9
10
 
10
- type HookHandler = () => void | Promise<void>;
11
- interface ConfigApp {
12
- use: (...handlers: MiddlewareHandler[]) => void;
13
- }
14
- type DefineConfigFactory = (context: {
15
- app: ConfigApp;
16
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
17
- declare function onBeforeAll(handler: HookHandler): void;
18
- declare function onAfterAll(handler: HookHandler): void;
19
- /**
20
- * Define a directory config with hook-based middleware registration.
21
- *
22
- * @param input - Config object or factory callback.
23
- * @returns Route directory config with middleware metadata.
24
- *
25
- * @example
26
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/server'
27
- *
28
- * export default defineConfig(({ app }) => {
29
- * onBeforeAll(() => {
30
- * app.use(async (c, next) => {
31
- * c.header('x-before', '1')
32
- * await next()
33
- * })
34
- * })
35
- *
36
- * app.use(async (_c, next) => {
37
- * await next()
38
- * })
39
- *
40
- * onAfterAll(() => {
41
- * app.use(async (c, next) => {
42
- * await next()
43
- * c.header('x-after', '1')
44
- * })
45
- * })
46
- *
47
- * return { delay: 120 }
48
- * })
49
- */
50
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
11
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
12
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
13
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
51
14
 
52
15
  export { RouteDirectoryConfig, defineConfig, onAfterAll, onBeforeAll };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
1
2
  import { R as RouteDirectoryConfig } from './shared/server.DLPB_I9q.js';
2
3
  export { H as HookErrorPolicy, M as MiddlewarePosition, a as MiddlewareRegistry, b as ResolvedMiddleware, c as RouteRule } from './shared/server.DLPB_I9q.js';
3
4
  import { MiddlewareHandler } from '@mokup/shared/hono';
@@ -7,46 +8,8 @@ export { F as FetchHandler, S as ServerOptions, W as WorkerBundle, a as WorkerIn
7
8
  export { createMokupWorker } from './worker.js';
8
9
  export { Manifest, ManifestRoute, ModuleMap, RuntimeOptions } from '@mokup/runtime';
9
10
 
10
- type HookHandler = () => void | Promise<void>;
11
- interface ConfigApp {
12
- use: (...handlers: MiddlewareHandler[]) => void;
13
- }
14
- type DefineConfigFactory = (context: {
15
- app: ConfigApp;
16
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
17
- declare function onBeforeAll(handler: HookHandler): void;
18
- declare function onAfterAll(handler: HookHandler): void;
19
- /**
20
- * Define a directory config with hook-based middleware registration.
21
- *
22
- * @param input - Config object or factory callback.
23
- * @returns Route directory config with middleware metadata.
24
- *
25
- * @example
26
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/server'
27
- *
28
- * export default defineConfig(({ app }) => {
29
- * onBeforeAll(() => {
30
- * app.use(async (c, next) => {
31
- * c.header('x-before', '1')
32
- * await next()
33
- * })
34
- * })
35
- *
36
- * app.use(async (_c, next) => {
37
- * await next()
38
- * })
39
- *
40
- * onAfterAll(() => {
41
- * app.use(async (c, next) => {
42
- * await next()
43
- * c.header('x-after', '1')
44
- * })
45
- * })
46
- *
47
- * return { delay: 120 }
48
- * })
49
- */
50
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
11
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
12
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
13
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
51
14
 
52
15
  export { RouteDirectoryConfig, defineConfig, onAfterAll, onBeforeAll };
package/dist/index.mjs CHANGED
@@ -1,166 +1,14 @@
1
+ import { createDefineConfig } from '@mokup/shared/define-config';
1
2
  export { createFetchHandler } from './fetch.mjs';
2
3
  export { createMokupWorker } from './worker.mjs';
3
4
  import '@mokup/runtime';
4
- import './shared/server.LbftO9Jh.mjs';
5
+ import './shared/server.B5ThEHd_.mjs';
5
6
 
6
- const middlewareSymbol = Symbol.for("mokup.config.middlewares");
7
- const contextStack = [];
8
- function getActiveContext() {
9
- const context = contextStack[contextStack.length - 1];
10
- if (!context) {
11
- throw new Error("onBeforeAll/onAfterAll must be called inside defineConfig()");
12
- }
13
- return context;
14
- }
15
- function runWithContext(context, fn) {
16
- contextStack.push(context);
17
- try {
18
- const result = fn();
19
- if (isPromise(result)) {
20
- return result.finally(() => {
21
- contextStack.pop();
22
- });
23
- }
24
- contextStack.pop();
25
- return result;
26
- } catch (error) {
27
- contextStack.pop();
28
- throw error;
29
- }
30
- }
31
- function isPromise(value) {
32
- return !!value && typeof value.then === "function";
33
- }
34
- function normalizeHookError(policy) {
35
- if (policy === "throw" || policy === "silent") {
36
- return policy;
37
- }
38
- return "warn";
39
- }
40
- function reportHookError(error, policy) {
41
- if (policy === "silent") {
42
- return;
43
- }
44
- if (policy === "warn") {
45
- console.warn("[@mokup/server] defineConfig hook failed:", error);
46
- }
47
- }
48
- function runHookSequence(stage, hooks, policy, setStage) {
49
- if (hooks.length === 0) {
50
- return;
51
- }
52
- setStage(stage);
53
- let chain = null;
54
- const runHook = (hook) => {
55
- try {
56
- const result = hook();
57
- if (isPromise(result)) {
58
- return result.catch((error) => {
59
- if (policy === "throw") {
60
- throw error;
61
- }
62
- reportHookError(error, policy);
63
- });
64
- }
65
- return void 0;
66
- } catch (error) {
67
- if (policy === "throw") {
68
- throw error;
69
- }
70
- reportHookError(error, policy);
71
- return void 0;
72
- }
73
- };
74
- for (const hook of hooks) {
75
- if (chain) {
76
- chain = chain.then(() => runHook(hook));
77
- continue;
78
- }
79
- const result = runHook(hook);
80
- if (isPromise(result)) {
81
- chain = result;
82
- }
83
- }
84
- if (!chain) {
85
- setStage("normal");
86
- return;
87
- }
88
- return chain.finally(() => {
89
- setStage("normal");
90
- });
91
- }
92
- function attachMetadata(config, meta) {
93
- Object.defineProperty(config, middlewareSymbol, {
94
- value: meta,
95
- enumerable: false
96
- });
97
- return config;
98
- }
99
- function normalizeConfig(value) {
100
- return value && typeof value === "object" ? value : {};
101
- }
102
- function onBeforeAll(handler) {
103
- if (typeof handler !== "function") {
104
- throw new TypeError("onBeforeAll expects a function");
105
- }
106
- const context = getActiveContext();
107
- context.hooks.pre.push(handler);
108
- }
109
- function onAfterAll(handler) {
110
- if (typeof handler !== "function") {
111
- throw new TypeError("onAfterAll expects a function");
112
- }
113
- const context = getActiveContext();
114
- context.hooks.post.push(handler);
115
- }
116
- function defineConfig(input) {
117
- if (typeof input === "function") {
118
- const pre = [];
119
- const normal = [];
120
- const post = [];
121
- let stage = "normal";
122
- const app = {
123
- use: (...handlers) => {
124
- if (stage === "pre") {
125
- pre.push(...handlers);
126
- return;
127
- }
128
- if (stage === "post") {
129
- post.push(...handlers);
130
- return;
131
- }
132
- normal.push(...handlers);
133
- }
134
- };
135
- const context = {
136
- app,
137
- hooks: { pre: [], post: [] },
138
- setStage: (next) => {
139
- stage = next;
140
- }
141
- };
142
- const result = runWithContext(context, () => input({ app }));
143
- const finalize = (value) => {
144
- const config2 = normalizeConfig(value);
145
- const policy = normalizeHookError(config2.hookError);
146
- const preResult = runHookSequence("pre", context.hooks.pre, policy, context.setStage);
147
- const runPost = () => runHookSequence("post", context.hooks.post, policy, context.setStage);
148
- if (isPromise(preResult)) {
149
- return preResult.then(runPost).then(() => attachMetadata(config2, { pre, normal, post }));
150
- }
151
- const postResult = runPost();
152
- if (isPromise(postResult)) {
153
- return postResult.then(() => attachMetadata(config2, { pre, normal, post }));
154
- }
155
- return attachMetadata(config2, { pre, normal, post });
156
- };
157
- if (isPromise(result)) {
158
- return result.then(finalize);
159
- }
160
- return finalize(result);
161
- }
162
- const config = normalizeConfig(input);
163
- return attachMetadata(config, { pre: [], normal: [], post: [] });
164
- }
7
+ const shared = createDefineConfig({
8
+ logPrefix: "[@mokup/server]"
9
+ });
10
+ const defineConfig = shared.defineConfig;
11
+ const onBeforeAll = shared.onBeforeAll;
12
+ const onAfterAll = shared.onAfterAll;
165
13
 
166
14
  export { defineConfig, onAfterAll, onBeforeAll };
package/dist/koa.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const runtime = require('@mokup/runtime');
4
- const runtime$1 = require('./shared/server.aaygIV2Q.cjs');
4
+ const runtime$1 = require('./shared/server.D0X6h49r.cjs');
5
5
 
6
6
  function createKoaMiddleware(options) {
7
7
  const runtime$2 = runtime.createRuntime(runtime$1.toRuntimeOptions(options));
package/dist/koa.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRuntime } from '@mokup/runtime';
2
- import { t as toRuntimeOptions, a as toRuntimeRequestFromNode, c as toBinaryBody } from './shared/server.LbftO9Jh.mjs';
2
+ import { t as toRuntimeOptions, a as toRuntimeRequestFromNode, c as toBinaryBody } from './shared/server.B5ThEHd_.mjs';
3
3
 
4
4
  function createKoaMiddleware(options) {
5
5
  const runtime = createRuntime(toRuntimeOptions(options));
package/dist/node.cjs CHANGED
@@ -9,21 +9,25 @@ const koa = require('./koa.cjs');
9
9
  const workerNode = require('./worker-node.cjs');
10
10
  const nodeServer = require('@hono/node-server');
11
11
  require('@mokup/runtime');
12
- require('./shared/server.aaygIV2Q.cjs');
12
+ require('./shared/server.D0X6h49r.cjs');
13
13
  require('@mokup/shared/pathe');
14
14
  require('node:fs');
15
15
  require('node:module');
16
16
  require('@mokup/shared/playground-grouping');
17
+ require('@mokup/shared/route-utils');
18
+ require('@mokup/shared/config-utils');
19
+ require('@mokup/shared/module-loader');
20
+ require('@mokup/shared/route-constants');
21
+ require('@mokup/shared/mock-files');
22
+ require('@mokup/shared/load-rules');
23
+ require('@mokup/shared/scan-utils');
17
24
  require('@mokup/shared/path-utils');
18
25
  require('@mokup/shared/timing');
19
- require('node:buffer');
20
- require('node:url');
21
- require('@mokup/shared/esbuild');
22
- require('node:process');
23
- require('@mokup/shared/jsonc-parser');
24
26
  require('@mokup/shared/hono');
27
+ require('node:process');
25
28
  require('./fetch.cjs');
26
29
  require('node:path');
30
+ require('node:url');
27
31
 
28
32
 
29
33
 
package/dist/node.mjs CHANGED
@@ -7,18 +7,22 @@ export { createKoaMiddleware } from './koa.mjs';
7
7
  export { createMokupWorker } from './worker-node.mjs';
8
8
  export { serve } from '@hono/node-server';
9
9
  import '@mokup/runtime';
10
- import './shared/server.LbftO9Jh.mjs';
10
+ import './shared/server.B5ThEHd_.mjs';
11
11
  import '@mokup/shared/pathe';
12
12
  import 'node:fs';
13
13
  import 'node:module';
14
14
  import '@mokup/shared/playground-grouping';
15
+ import '@mokup/shared/route-utils';
16
+ import '@mokup/shared/config-utils';
17
+ import '@mokup/shared/module-loader';
18
+ import '@mokup/shared/route-constants';
19
+ import '@mokup/shared/mock-files';
20
+ import '@mokup/shared/load-rules';
21
+ import '@mokup/shared/scan-utils';
15
22
  import '@mokup/shared/path-utils';
16
23
  import '@mokup/shared/timing';
17
- import 'node:buffer';
18
- import 'node:url';
19
- import '@mokup/shared/esbuild';
20
- import 'node:process';
21
- import '@mokup/shared/jsonc-parser';
22
24
  import '@mokup/shared/hono';
25
+ import 'node:process';
23
26
  import './fetch.mjs';
24
27
  import 'node:path';
28
+ import 'node:url';
@@ -193,7 +193,7 @@ async function toRuntimeRequestFromFetch(request) {
193
193
  async function toRuntimeRequestFromNode(req, bodyOverride) {
194
194
  const headers = normalizeNodeHeaders(req.headers);
195
195
  const contentType = (headers["content-type"] ?? "").split(";")[0]?.trim() ?? "";
196
- const url = resolveUrl(req.originalUrl ?? req.url ?? "/", headers);
196
+ const url = resolveUrl(req.url ?? req.originalUrl ?? "/", headers);
197
197
  const resolvedBody = await resolveBody(
198
198
  typeof bodyOverride === "undefined" ? req.body : bodyOverride,
199
199
  contentType,
@@ -195,7 +195,7 @@ async function toRuntimeRequestFromFetch(request) {
195
195
  async function toRuntimeRequestFromNode(req, bodyOverride) {
196
196
  const headers = normalizeNodeHeaders(req.headers);
197
197
  const contentType = (headers["content-type"] ?? "").split(";")[0]?.trim() ?? "";
198
- const url = resolveUrl(req.originalUrl ?? req.url ?? "/", headers);
198
+ const url = resolveUrl(req.url ?? req.originalUrl ?? "/", headers);
199
199
  const resolvedBody = await resolveBody(
200
200
  typeof bodyOverride === "undefined" ? req.body : bodyOverride,
201
201
  contentType,
@@ -4,7 +4,7 @@ const node_path = require('node:path');
4
4
  const node_url = require('node:url');
5
5
  const fetch = require('./fetch.cjs');
6
6
  require('@mokup/runtime');
7
- require('./shared/server.aaygIV2Q.cjs');
7
+ require('./shared/server.D0X6h49r.cjs');
8
8
 
9
9
  function ensureTrailingSlash(value) {
10
10
  return value.endsWith("/") ? value : `${value}/`;
@@ -2,7 +2,7 @@ import { resolve } from 'node:path';
2
2
  import { pathToFileURL } from 'node:url';
3
3
  import { createFetchHandler } from './fetch.mjs';
4
4
  import '@mokup/runtime';
5
- import './shared/server.LbftO9Jh.mjs';
5
+ import './shared/server.B5ThEHd_.mjs';
6
6
 
7
7
  function ensureTrailingSlash(value) {
8
8
  return value.endsWith("/") ? value : `${value}/`;
package/dist/worker.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fetch = require('./fetch.cjs');
4
4
  require('@mokup/runtime');
5
- require('./shared/server.aaygIV2Q.cjs');
5
+ require('./shared/server.D0X6h49r.cjs');
6
6
 
7
7
  function isStringInput(value) {
8
8
  return typeof value === "string";
package/dist/worker.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createFetchHandler } from './fetch.mjs';
2
2
  import '@mokup/runtime';
3
- import './shared/server.LbftO9Jh.mjs';
3
+ import './shared/server.B5ThEHd_.mjs';
4
4
 
5
5
  function isStringInput(value) {
6
6
  return typeof value === "string";