🎉 - First commit!

This commit is contained in:
Florian Sylvain
2022-11-10 10:52:29 +01:00
commit d4fda082c1
11 changed files with 1267 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import express from 'express'
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
export const indexRouter = express.Router()
indexRouter.get('/', async (req, res, next) => {
res.send({message:"voila ton index"})
})
indexRouter.get('/articles', async (req, res, next) => {
const articles = await prisma.article.findMany({})
res.send({
message:"voila tes articles",
articles
})
})