File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
src/app/api/generateWallpaper Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ COPY package.json package-lock.json* ./
9
9
10
10
# Install dependencies
11
11
RUN npm install --legacy-peer-deps
12
- RUN npm ci
13
12
# Copy the rest of the application files
14
13
COPY . .
15
14
@@ -22,12 +21,11 @@ FROM builder AS runner
22
21
# Set the working directory
23
22
WORKDIR /app
24
23
COPY --from=builder /app/public ./public
25
- COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
26
24
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
27
25
28
26
# Expose the application port
29
27
EXPOSE 3100
30
28
31
29
# Start the application on port 3100
32
30
ENV PORT=3100
33
- CMD ["npm" , "run" , "dev" ]
31
+ CMD ["npm" , "run" , "dev" ]
Original file line number Diff line number Diff line change 1
1
import { NextResponse } from 'next/server' ;
2
2
import axios from 'axios' ;
3
+ export const maxDuration = 60 ; // This function can run for a maximum of 5 seconds
4
+ export const dynamic = 'force-dynamic' ;
3
5
4
6
export async function POST ( request : Request ) {
5
7
try {
@@ -29,10 +31,4 @@ export async function POST(request: Request) {
29
31
console . error ( 'Error generating images:' , error ) ;
30
32
return NextResponse . json ( { error : 'Failed to generate images' } , { status : 500 } ) ;
31
33
}
32
- }
33
-
34
-
35
- // // Validate environment variables
36
- // const endpoint = process.env.AZURE_OPENAI_ENDPOINT;
37
- // const key = process.env.AZURE_OPENAI_KEY;
38
- // const apiVersion = '2024-02-01';
34
+ }
You can’t perform that action at this time.
0 commit comments