Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Next13 edge api route and environment variable question #2202

Unanswered
weidezhang asked this question in Q&A
Discussion options

Hi Community,

I have two questions about edge function in netlify. Any help is greatly appreciated.

  1. when deploying nextjs 13 project on netilfy, will API routes using edge runtime becomes edge functions in netlify as well ?

  2. how to access environmental variables if treated as edge function. will process.env still work or I have to use the netlify.env global variable. Is there any good example showing how ? Thank you ,
    The below is one example i’m trying to use but failed under "netlify dev" testing .

export const config = {
 runtime: 'experimental-edge'
};
export default () =>
 new Response(JSON.stringify(Netlify.env.toObject(), null, 2));
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /