wildpig 1.4.0 → 1.4.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/package.json +1 -2
- package/scripts/devServer.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wildpig",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"author": "eriktse",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "ISC",
|
|
31
31
|
"scripts": {
|
|
32
|
-
"publish": "yalc publish",
|
|
33
32
|
"dev": "wildpig dev",
|
|
34
33
|
"build": "wildpig build",
|
|
35
34
|
"start": "wildpig start"
|
package/scripts/devServer.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getApiRouteModules } from "./apiRoutes";
|
|
2
2
|
import { createServer as createViteServer } from "vite";
|
|
3
|
-
import {
|
|
3
|
+
import { matchRoutes } from "react-router";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
|
|
6
6
|
const __dirname = import.meta.dirname;
|
|
@@ -33,10 +33,11 @@ const viteHandler = (apiModules: any) => async (request: Request) => {
|
|
|
33
33
|
viteURL.port = viteServer.config.server.port.toString();
|
|
34
34
|
console.log("转发请求:" + viteURL.toString());
|
|
35
35
|
const response = await fetch(viteURL.toString(), {
|
|
36
|
-
headers: request.headers,
|
|
37
36
|
method: request.method,
|
|
37
|
+
headers: request.headers,
|
|
38
|
+
body: request.body,
|
|
38
39
|
});
|
|
39
|
-
return response;
|
|
40
|
+
return response.clone();
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const matches = matchRoutes(pageRoutes, url.pathname);
|