mirror of
https://github.com/Floriansylvain/CineAllo.git
synced 2026-08-19 11:43:24 +02:00
🎉 - First commit!
This commit is contained in:
@@ -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
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import express from 'express'
|
||||
|
||||
export const usersRouter = express.Router()
|
||||
|
||||
usersRouter.get('/', function(req, res, next) {
|
||||
res.send({message:"voila tes users"})
|
||||
})
|
||||
Reference in New Issue
Block a user