forked from netlify/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set Netlify environment variables in edge functions (netlify#6229)
* feat: set Netlify environment variables in edge functions * chore: fix test * refactor: use `localhost` * fix: use right protocol
- Loading branch information
1 parent
d37ec4b
commit 3268f29
Showing
5 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { env } from 'process' | ||
|
||
const latestBootstrapURL = 'https://65437779a0c9990008b54abe--edge.netlify.com/bootstrap/index-combined.ts' | ||
const latestBootstrapURL = 'https://656703bb61f20c00084a3479--edge.netlify.com/bootstrap/index-combined.ts' | ||
|
||
export const getBootstrapURL = () => env.NETLIFY_EDGE_BOOTSTRAP || latestBootstrapURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ntegration/__fixtures__/dev-server-with-edge-functions/netlify/edge-functions/echo-env.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Config, Context } from 'https://edge.netlify.com' | ||
|
||
export default (_, context: Context) => Response.json(Netlify.env.toObject()) | ||
|
||
export const config: Config = { | ||
path: '/echo-env', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters