mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-07 06:53:54 +05:00
refactor/api-prox: config.json -> config.ts
This commit is contained in:
parent
83fe8e80e3
commit
002b5a446c
6 changed files with 23 additions and 9 deletions
|
@ -7,6 +7,8 @@
|
|||
"hono": "^4.9.6",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.17",
|
||||
"typescript": "^5.9.2",
|
||||
"wrangler": "^4.4.0",
|
||||
},
|
||||
},
|
||||
|
@ -134,6 +136,8 @@
|
|||
|
||||
"@speed-highlight/core": ["@speed-highlight/core@1.2.7", "", {}, "sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g=="],
|
||||
|
||||
"@types/node": ["@types/node@20.19.13", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-yCAeZl7a0DxgNVteXFHt9+uyFbqXGy/ShC4BlcHkoE0AfGXYv/BUiplV72DjMYXHDBXFjhvr6DD1NiRVfB4j8g=="],
|
||||
|
||||
"acorn": ["acorn@8.14.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="],
|
||||
|
||||
"acorn-walk": ["acorn-walk@8.3.2", "", {}, "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A=="],
|
||||
|
@ -194,10 +198,14 @@
|
|||
|
||||
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||
|
||||
"typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="],
|
||||
|
||||
"ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="],
|
||||
|
||||
"undici": ["undici@7.15.0", "", {}, "sha512-7oZJCPvvMvTd0OlqWsIxTuItTpJBpU1tcbVl24FMn3xt3+VSunwUasmfPJRE57oNO1KsZ4PgA1xTdAX4hq8NyQ=="],
|
||||
|
||||
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||
|
||||
"unenv": ["unenv@2.0.0-rc.20", "", { "dependencies": { "defu": "^6.1.4", "exsolve": "^1.0.7", "ohash": "^2.0.11", "pathe": "^2.0.3", "ufo": "^1.6.1" } }, "sha512-8tn4tAl9vD5nWoggAAPz28vf0FY8+pQAayhU94qD+ZkIbVKCBAH/E1MWEEmhb9Whn5EgouYVfBJB20RsTLRDdg=="],
|
||||
|
||||
"workerd": ["workerd@1.20250902.0", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20250902.0", "@cloudflare/workerd-darwin-arm64": "1.20250902.0", "@cloudflare/workerd-linux-64": "1.20250902.0", "@cloudflare/workerd-linux-arm64": "1.20250902.0", "@cloudflare/workerd-windows-64": "1.20250902.0" }, "bin": { "workerd": "bin/workerd" } }, "sha512-rM+8ARYoy9gWJNPW89ERWyjbp7+m1hu6PFbehiP8FW9Hm5kNVo71lXFrkCP2HSsTP1OLfIU/IwanYOijJ0mQDw=="],
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
"hono": "^4.9.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"wrangler": "^4.4.0"
|
||||
"@types/node": "^20.11.17",
|
||||
"wrangler": "^4.4.0",
|
||||
"typescript": "^5.9.2"
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
{"appVersion": "0.0.1"}
|
1
api-prox/src/config.ts
Normal file
1
api-prox/src/config.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const appVersion = "0.0.0";
|
|
@ -1,7 +1,7 @@
|
|||
import { Hono } from "hono";
|
||||
import { trimTrailingSlash } from 'hono/trailing-slash'
|
||||
import { asciiHTML, separatorHTML } from "./utils/info.js";
|
||||
import config from "./config.json" with { type: "json" };
|
||||
import { appVersion } from "./config.js";
|
||||
|
||||
const app = new Hono({ strict: true });
|
||||
app.use(trimTrailingSlash())
|
||||
|
@ -49,14 +49,14 @@ app.get("/health", (c) => {
|
|||
${asciiHTML()}
|
||||
${separatorHTML()}
|
||||
<p id="status">Status: OK</p>
|
||||
<p>Version: ${config.appVersion}</p>
|
||||
<p>Version: ${appVersion}</p>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
});
|
||||
|
||||
app.get("/health/json", (c) => {
|
||||
return c.json({"status": "OK", "version": config.appVersion});
|
||||
return c.json({"status": "OK", "version": appVersion});
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
|
|
@ -3,14 +3,18 @@
|
|||
"target": "ESNext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"lib": [
|
||||
"ESNext"
|
||||
],
|
||||
"lib": ["ESNext"],
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "hono/jsx",
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue