mock-fried 1.0.2 → 1.0.3
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/module.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineEventHandler, getQuery, readBody, createError
|
|
1
|
+
import { defineEventHandler, getQuery, readBody, createError } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import yaml from "js-yaml";
|
|
@@ -290,9 +290,8 @@ function handleClientPackageRequest(pkg, generator, cursorManager, pageManager,
|
|
|
290
290
|
export default defineEventHandler(async (event) => {
|
|
291
291
|
const config = useRuntimeConfig(event);
|
|
292
292
|
const mockConfig = config.mock;
|
|
293
|
-
const requestUrl = getRequestURL(event);
|
|
294
293
|
const prefix = mockConfig?.prefix || "/mock";
|
|
295
|
-
let path =
|
|
294
|
+
let path = event.path;
|
|
296
295
|
if (path.startsWith(prefix)) {
|
|
297
296
|
path = path.substring(prefix.length) || "/";
|
|
298
297
|
}
|