umami/pages/api/website/[id]/index.js

13 lines
275 B
JavaScript
Raw Normal View History

2020-08-01 04:05:14 +02:00
import { getWebsite } from 'lib/db';
import { useAuth } from 'lib/middleware';
export default async (req, res) => {
await useAuth(req, res);
const { id } = req.query;
2020-08-04 03:12:28 +02:00
const website = await getWebsite({ website_id: +id });
2020-08-01 04:05:14 +02:00
return res.status(200).json(website);
};