mirror of
https://github.com/Floriansylvain/CineAllo.git
synced 2026-08-19 19:53:16 +02:00
18 lines
419 B
JavaScript
18 lines
419 B
JavaScript
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
|
|
})
|
|
})
|