add: data from MongoDB
Retrieve Data from MongoDB
This commit is contained in:
parent
85e6035a9a
commit
987b685c41
10 changed files with 5361 additions and 41 deletions
9
server/api/products/index.get.ts
Normal file
9
server/api/products/index.get.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
export default defineEventHandler(async () => {
|
||||
try {
|
||||
return await ProductSchema.find()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return []
|
||||
}
|
||||
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue