Skip to content

Commit

Permalink
fixing vercel hosting problem
Browse files Browse the repository at this point in the history
  • Loading branch information
admineral committed Sep 25, 2024
1 parent 337819e commit d514cca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
20 changes: 18 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
await import("./src/env.js");

/** @type {import("next").NextConfig} */
const config = {};
const config = {
reactStrictMode: true,
// Die 'appDir' Option ist nicht mehr nötig, da sie jetzt standardmäßig aktiviert ist
async headers() {
return [
{
source: '/api/redis/process',
headers: [
{
key: 'Cache-Control',
value: 'no-store, max-age=0',
},
],
},
];
},
};

export default config;
export default config;
2 changes: 2 additions & 0 deletions src/app/api/redis/process/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const dynamic = 'force-dynamic';
export const revalidate = 0;
4 changes: 1 addition & 3 deletions src/app/api/redis/process/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// /app/api/redis/process/route.ts

import { NextRequest, NextResponse } from 'next/server';
import Redis from 'ioredis';
import { z } from 'zod';
Expand Down Expand Up @@ -169,7 +167,7 @@ const processCSVFiles = async (sendProgress: (message: string) => void) => {
// GET handler to initiate CSV processing and stream progress via SSE
export async function GET(request: NextRequest) {
// Check if we're in build mode
if (process.env.NEXT_PUBLIC_IS_BUILD === 'true') {
if (env.NEXT_PUBLIC_IS_BUILD === 'true') {
// Return a mock response during build time
return NextResponse.json({ message: 'CSV processing is not available during build time' });
}
Expand Down

0 comments on commit d514cca

Please # to comment.