feat(server): 管理面与成员视图 API + Scalar 在线文档
契约 19 路径全量:引导/会话/改密、engine 桩、keys、overview/logs、payments、 qpu、members、audit、成员视图。鉴权优先、422 信封、登录节流、上游验证接线。
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { createApp } from "./app.ts";
|
||||
import { loadEnv } from "./env.ts";
|
||||
import { createDb } from "@new-api-key-usage/db";
|
||||
import { appLogger, setupLogging } from "@new-api-key-usage/core";
|
||||
|
||||
const env = loadEnv(process.env);
|
||||
setupLogging(env.LOG_LEVEL);
|
||||
|
||||
const db = createDb(env.DATABASE_URL);
|
||||
|
||||
const app = createApp({
|
||||
db,
|
||||
skKeyEncryptionSecret: env.SK_KEY_ENCRYPTION_SECRET,
|
||||
newapiBase: env.NEWAPI_BASE,
|
||||
cookieSecure: env.COOKIE_SECURE,
|
||||
adminInitUsername: env.ADMIN_INIT_USERNAME,
|
||||
adminInitPassword: env.ADMIN_INIT_PASSWORD,
|
||||
});
|
||||
|
||||
appLogger("server").info`listening on port ${env.PORT} (cookie_secure=${env.COOKIE_SECURE}, log_level=${env.LOG_LEVEL})`;
|
||||
|
||||
export default {
|
||||
port: env.PORT,
|
||||
fetch: app.fetch,
|
||||
};
|
||||
Reference in New Issue
Block a user