Force APIs to use SSR instead of static generation #4
8 changed files with 24 additions and 0 deletions
|
@ -1,6 +1,9 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
// Handler for GET requests
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { serialize } from "cookie";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const { username, password } = await request.json();
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
// Handler for GET requests
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
// Handler for GET requests
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { fileName, version, downloadLink, fileSize } = body;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { fileName, version, downloadLink, fileSize } = body;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import clientPromise from "@/lib/db";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { fileName, version, downloadLink, fileSize } = body;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { createRouteHandler } from "uploadthing/next";
|
||||
import { ourFileRouter } from "./core";
|
||||
|
||||
// Force the API to use SSR instead of static generation
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export const { GET, POST } = createRouteHandler({
|
||||
router: ourFileRouter,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue