Skip to content

Commit

Permalink
feat: 配置化函数运行时
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Apr 3, 2024
1 parent 44c9a1e commit a630812
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api/login/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'server-only'
import { NextRequest } from 'next/server'

export const runtime = 'edge'
export const runtime = process.env.runtime

export async function POST(request: NextRequest) {
const res = await request.json()
Expand Down
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
env: {
runtime: 'nodejs', // Function Runtime, 'nodejs' (default) | 'edge'
}
};

export default nextConfig;

0 comments on commit a630812

Please sign in to comment.