Skip to content

Commit a2c88b7

Browse files
committed
chore: use city in demo
1 parent d9011d0 commit a2c88b7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

demos/middleware/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function middleware(request: NextRequest) {
5656
// Unlike NextResponse.next(), this actually sends the request to the origin
5757
const res = await NetlifyResponse.next(request)
5858
res.transformData((data) => {
59-
data.pageProps.message = `This was static but has been transformed in ${request.geo.country}`
59+
data.pageProps.message = `This was static but has been transformed in ${request.geo.city}`
6060
data.pageProps.showAd = true
6161
return data
6262
})

demos/middleware/pages/static.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
const Page = ({ message, showAd }) => (
22
<div>
33
<p>{message}</p>
4-
{showAd ? <div>This is an ad that isn't shown by default</div> : <p>No ads for me</p>}
4+
{showAd ? (
5+
<div>
6+
<p>This is an ad that isn't shown by default</p>
7+
<img src="http://placekitten.com/400/300" />
8+
</div>
9+
) : (
10+
<p>No ads for me</p>
11+
)}
512
</div>
613
)
714

0 commit comments

Comments
 (0)