Support sub-path deploy via NEXT_PUBLIC_BASE_PATH (loma.chat/pagiva)
Adds basePath config, withBase/appUrl helpers, base-path-aware cookies, OAuth redirects, manifest, service worker and cron runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { appUrl } from "@/lib/base-path";
|
||||
import { NextResponse } from "next/server";
|
||||
import { putBlob } from "@/lib/storage/blob";
|
||||
import { requirePageAction } from "@/lib/auth/user";
|
||||
@@ -26,7 +27,7 @@ export async function POST(req: Request) {
|
||||
|
||||
try {
|
||||
const ext = file.type === "image/png" ? "png" : "jpg";
|
||||
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || new URL(req.url).origin;
|
||||
const baseUrl = appUrl(new URL(req.url).origin);
|
||||
const blob = await putBlob(`posts/${pageId}/image.${ext}`, file, { contentType: file.type }, baseUrl);
|
||||
return NextResponse.json({ url: blob.url });
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user