feat: 版本管理,package.json 唯一版本源、/api/meta 返回版本、Dashboard Header 展示版本号
This commit is contained in:
@@ -16,10 +16,11 @@ export interface StartServerOptions {
|
||||
mode: RuntimeMode;
|
||||
staticAssets?: StaticAssets;
|
||||
store: ProbeStore;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export function startServer(options: StartServerOptions) {
|
||||
const { config, mode, staticAssets, store } = options;
|
||||
const { config, mode, staticAssets, store, version } = options;
|
||||
|
||||
const server = Bun.serve({
|
||||
fetch(req) {
|
||||
@@ -36,7 +37,7 @@ export function startServer(options: StartServerOptions) {
|
||||
GET: (req) => handleDashboard(new URL(req.url), store, mode),
|
||||
},
|
||||
"/api/meta": {
|
||||
GET: () => handleMeta(mode),
|
||||
GET: () => handleMeta(mode, version),
|
||||
},
|
||||
"/api/targets/:id/history": {
|
||||
GET: (req) => handleHistory(req.params.id, new URL(req.url), store, mode),
|
||||
|
||||
Reference in New Issue
Block a user