web: 管理画面のポートを3001に変更
- composeのwebを --port 3001 で起動し、ホスト側も3001に公開 - APIのCORS許可オリジン(WEB_ORIGIN)とconfig.tsのデフォルトを3001に追従
This commit is contained in:
@@ -15,7 +15,7 @@ const schema = z.object({
|
||||
HOST: z.string().default("0.0.0.0"),
|
||||
PORT: numberFromEnv.default(4000),
|
||||
PUBLIC_BASE_URL: z.string().url().default("http://localhost:4000"),
|
||||
WEB_ORIGIN: z.string().url().default("http://localhost:3000"),
|
||||
WEB_ORIGIN: z.string().url().default("http://localhost:3001"),
|
||||
DATABASE_URL: z.string().optional(),
|
||||
STORAGE_MODE: z.enum(["local", "s3"]).default("local"),
|
||||
LOCAL_STORAGE_DIR: z.string().default(".data/storage"),
|
||||
|
||||
@@ -78,7 +78,7 @@ export async function createServer() {
|
||||
// them in memory, so a 5 GiB ADP doesn't exhaust the process.
|
||||
app.addContentTypeParser(["application/zip", "application/octet-stream"], (_request, payload, done) => done(null, payload));
|
||||
await app.register(cookie);
|
||||
// The control plane (web :3000) and API (:4000) are cross-origin, so allow
|
||||
// The control plane (web :3001) and API (:4000) are cross-origin, so allow
|
||||
// the write methods the dashboard uses; @fastify/cors otherwise defaults to
|
||||
// GET/HEAD/POST and blocks PATCH/PUT in the browser.
|
||||
await app.register(cors, { origin: true, credentials: true, methods: ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"] });
|
||||
|
||||
Reference in New Issue
Block a user