From c8d577aa3c6eabeeb44fd58f2e7c04d8bd2939e6 Mon Sep 17 00:00:00 2001 From: Jemima Date: Thu, 23 Nov 2023 10:56:17 +0000 Subject: [PATCH] =?UTF-8?q?Fundamentos=20do=20Next.js=20-=20Criando=20rota?= =?UTF-8?q?s=20da=20aplica=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - see notes at (#1)[https://github.com/jemluz/ignite-shop/issues/1] --- src/pages/product/[id].tsx | 9 +++++++++ src/pages/success.tsx | 5 +++++ tsconfig.json | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/pages/product/[id].tsx create mode 100644 src/pages/success.tsx diff --git a/src/pages/product/[id].tsx b/src/pages/product/[id].tsx new file mode 100644 index 0000000..2e87e57 --- /dev/null +++ b/src/pages/product/[id].tsx @@ -0,0 +1,9 @@ +import { useRouter } from "next/router" + +export default function Product() { + const { query } = useRouter() + + return ( +

Product {JSON.stringify(query)}

+ ) +} \ No newline at end of file diff --git a/src/pages/success.tsx b/src/pages/success.tsx new file mode 100644 index 0000000..26d3a5f --- /dev/null +++ b/src/pages/success.tsx @@ -0,0 +1,5 @@ +export default function Success() { + return ( +

success

+ ) +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 670224f..112f50b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "bundler", + "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve",