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
const res = await fetch(`http://localhost:3000/api/todo/${id}`, | |
{ | |
next: { revalidate: 10 } | |
}); |
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
const getTodo = async (id: string) => { | |
try { | |
const res = await fetch(`http://localhost:3000/api/todo/${id}`); | |
const data = (await res).json(); | |
return data; | |
} catch (error) { | |
return {}; | |
} |
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
export const dynamic = true, | |
dynamicParams = true, | |
revalidate = 0, | |
fetchCache = 'force-no-store', | |
runtime = 'nodejs', | |
preferredRegion = 'auto'; |
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
const res = await fetch('http://localhost:3000/api/todo', | |
{ cache: 'no-store' }); | |
const data = (await res).json(); | |
return data; |
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
import Link from "next/link" | |
import './globals.css' | |
export const metadata = { | |
title: 'Create Next App', | |
description: 'Generated by create next app', | |
} | |
export default function RootLayout({ |
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
import Link from "next/link" | |
const getTodos = async () => { | |
try { | |
const res = await fetch('http://localhost:3000/api/todo'); | |
const data = (await res).json(); | |
return data; | |
} catch (error) { | |
return []; |
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
[ | |
{ | |
"id": 1, | |
"title": "Todo1", | |
"description": "Todo 1 description" | |
}, | |
{ | |
"id": 2, | |
"title": "Todo2", | |
"description": "Todo 2 description" |
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
export async function GET(request: Request) { | |
return new Response(JSON.stringify({ title: 'Todo', body: 'Todo description' })) | |
} |
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
export async function GET(request: Request) { | |
return new Response(JSON.stringify([ | |
{ | |
id: 1, | |
title: 'Todo1', | |
description: 'Todo 1 description' | |
}, | |
{ | |
id: 2, | |
title: 'Todo2', |
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
GET https://INSTANCE.salesforce.com/services/data/v54.0/sobjects/Lead/describe |
NewerOlder