File tree 6 files changed +171
-120
lines changed
6 files changed +171
-120
lines changed Original file line number Diff line number Diff line change 9
9
"ntl" : " ntl-internal"
10
10
},
11
11
"dependencies" : {
12
- "next" : " ^12.1.7-canary.1 " ,
12
+ "next" : " ^12.1.7-canary.4 " ,
13
13
"react" : " 18.0.0" ,
14
14
"react-dom" : " 18.0.0"
15
15
},
Original file line number Diff line number Diff line change
1
+ import { NextResponse } from 'next/server'
2
+ import { NextFetchEvent , NextRequest } from 'next/server'
3
+
4
+ export function middleware ( req : NextRequest , ev : NextFetchEvent ) {
5
+ let res = NextResponse . next ( )
6
+ res . cookies . set ( 'netlifyCookie' , 'true' )
7
+ return res
8
+ }
Original file line number Diff line number Diff line change
1
+ const Cookies = ( ) => {
2
+ return (
3
+ < div >
4
+ < p > The cookie "netlifyCookie" should be set to true</ p >
5
+ </ div >
6
+ )
7
+ }
8
+
9
+ export default Cookies
Original file line number Diff line number Diff line change @@ -16,9 +16,20 @@ export default function Home() {
16
16
Welcome to < a href = "https://nextjs.org" > Next.js!</ a >
17
17
</ h1 >
18
18
19
- < p > < Link href = "/shows/rewriteme" > Rewrite URL</ Link > </ p >
20
- < p > < Link href = "/shows/rewrite-absolute" > Rewrite to absolute URL</ Link > </ p >
21
- < p > < Link href = "/shows/rewrite-external" > Rewrite to external URL</ Link > </ p >
19
+ < p >
20
+ < Link href = "/shows/rewriteme" > Rewrite URL</ Link >
21
+ </ p >
22
+ < p >
23
+ < Link href = "/shows/rewrite-absolute" > Rewrite to absolute URL</ Link >
24
+ </ p >
25
+ < p >
26
+ < Link href = "/shows/rewrite-external" > Rewrite to external URL</ Link >
27
+ </ p >
28
+ < p >
29
+ < Link href = "/cookies" prefetch = { false } >
30
+ Cookie API
31
+ </ Link >
32
+ </ p >
22
33
</ main >
23
34
</ div >
24
35
)
Original file line number Diff line number Diff line change 18
18
"exclude" : [
19
19
" node_modules" ,
20
20
" ../../src/templates/edge/*"
21
+ ],
22
+ "include" : [
23
+ " next-env.d.ts" ,
24
+ " **/*.ts" ,
25
+ " **/*.tsx"
21
26
]
22
27
}
You can’t perform that action at this time.
0 commit comments