10 lines
303 B
JavaScript
10 lines
303 B
JavaScript
|
import { PrismaClient } from '@prisma/client'
|
||
|
const prisma = new PrismaClient()
|
||
|
import express from 'express'
|
||
|
const app = express.Router()
|
||
|
|
||
|
app.get('/', async (req, res) => {
|
||
|
res.json(await prisma.post.findMany({ take: 10, orderBy: { date: 'desc' }, include: { source: true }}))
|
||
|
})
|
||
|
|
||
|
export default app
|