wildpig 2.0.0 → 2.0.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 -1
- package/scripts/apiRoutes.ts +1 -2
- package/scripts/server.ts +1 -1
package/package.json
CHANGED
package/scripts/apiRoutes.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { readdirSync, statSync, writeFileSync } from "fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
const __dirname = import.meta.dirname;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const middleware = (await import("@/endpoints/middleware"!)).middleware;
|
|
5
|
+
const middleware = (await import("../../../src/endpoints/middleware"!)).middleware;
|
|
7
6
|
|
|
8
7
|
const getFilePaths = (dir: string) => {
|
|
9
8
|
const res: string[] = [];
|
package/scripts/server.ts
CHANGED
|
@@ -45,7 +45,7 @@ const frontHandler = (apiModules: any) => async (request: Request) => {
|
|
|
45
45
|
});
|
|
46
46
|
return response.clone();
|
|
47
47
|
}else{// production环境,直接返回文件
|
|
48
|
-
const filepath = "./client" + url.pathname;
|
|
48
|
+
const filepath = path.resolve(__dirname, "./client" + url.pathname);
|
|
49
49
|
// 检查文件是否存在
|
|
50
50
|
if(fs.existsSync(filepath) && fs.statSync(filepath).isFile()){
|
|
51
51
|
return new Response(Bun.file(filepath), {
|