-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand example to show before/after edge function modification
- Loading branch information
1 parent
e234bd7
commit 147b53a
Showing
6 changed files
with
69 additions
and
53 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
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 was deleted.
Oops, something went wrong.
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,19 @@ | ||
import { headers } from 'next/headers'; | ||
|
||
export default async function ExamplePage() { | ||
// Add in reference to headers() to force this page to be server-side rendered and handled as a cloud function. | ||
// Otherwise, this page will be rendered as a static page and not handled as a cloud function. | ||
const headersList = headers(); | ||
const referer = headersList.get('referer'); | ||
|
||
return ( | ||
<div className="flex min-h-screen flex-col items-center justify-center p-24"> | ||
<div className="text-center"> | ||
<h1>Edgio Cloud Functions</h1> | ||
<p>This page was rendered by Edgio Cloud Functions.</p> | ||
</div> | ||
|
||
<footer className="mt-auto">Referer: {referer}</footer> | ||
</div> | ||
); | ||
} |
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