start over with nextjs

This commit is contained in:
Thomas Ruoff
2021-02-25 00:31:28 +01:00
parent 3a77e7f22b
commit 214d95d3d7
68 changed files with 3047 additions and 18576 deletions

21
pages/api/pdf/latest.ts Normal file
View File

@@ -0,0 +1,21 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { list as storeList } from '../../../lib/store'
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (req.method !== 'GET') {
res.status(405).json({ statusCode: 405, message: 'Method Not Allowed' })
return;
}
try {
const latest = await storeList();
res.status(200).json(latest);
} catch (err) {
console.error('Error:', err, 'for', req.url);
res.status(500).json({ error: err.toString() });
}
}
export default handler