2022-01-21 11:15:39 +01:00
|
|
|
import { PrismaClient } from '@prisma/client'
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
import express from 'express'
|
|
|
|
const app = express.Router()
|
|
|
|
|
|
|
|
app.get('/', async (req, res) => {
|
2022-02-14 13:06:33 +01:00
|
|
|
res.json(await prisma.post.findMany({ take: 10, orderBy: { date: 'desc' }, include: { tags: true, source: true }}))
|
2022-01-21 11:15:39 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
export default app
|