-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: data.json and featured products route
- Loading branch information
1 parent
1c92cb9
commit e4c13b8
Showing
3 changed files
with
60 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"products": [ | ||
{ | ||
"id": 1, | ||
"title": "Moletom Never Stop Learning", | ||
"slug": "moletom-never-stop-learning", | ||
"price": 129, | ||
"image": "/moletom-never-stop-learning.png", | ||
"description": "Moletom fabricado com 88% de algodão e 12% de poliéster.", | ||
"featured": true | ||
}, | ||
{ | ||
"id": 2, | ||
"title": "Moletom AI Side", | ||
"slug": "moletom-ai-side", | ||
"price": 99, | ||
"image": "/moletom-ai-side.png", | ||
"description": "Moletom fabricado com 88% de algodão e 12% de poliéster.", | ||
"featured": true | ||
}, | ||
{ | ||
"id": 3, | ||
"title": "Camiseta DoWhile 2022", | ||
"slug": "camiseta-dowhile-2022", | ||
"price": 69, | ||
"image": "/camiseta-dowhile-2022.png", | ||
"description": "Camiseta fabricada com 100% de algodão.", | ||
"featured": true | ||
}, | ||
{ | ||
"id": 4, | ||
"title": "Moletom Java 2023", | ||
"slug": "moletom-java-2023", | ||
"price": 99, | ||
"image": "/moletom-java.png", | ||
"description": "Moletom fabricado com 88% de algodão e 12% de poliéster.", | ||
"featured": false | ||
}, | ||
{ | ||
"id": 5, | ||
"title": "Moletom IA p/ devs", | ||
"slug": "moletom-ia-p-devs", | ||
"price": 99, | ||
"image": "/moletom-ia-p-devs.png", | ||
"description": "Moletom fabricado com 88% de algodão e 12% de poliéster.", | ||
"featured": false | ||
} | ||
] | ||
} |
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,8 @@ | ||
import data from '../data.json' | ||
|
||
export async function GET() { | ||
|
||
const featuredProducts = data.products.filter((product) => product.featured) | ||
|
||
return Response.json(featuredProducts) | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import data from './data.json' | ||
|
||
export async function GET() { | ||
return Response.json({ message: 'Hello World' }) | ||
return Response.json(data.products) | ||
} |