umami/pages/api/website/[id]/index.js
2020-08-03 18:12:28 -07:00

13 lines
275 B
JavaScript

import { getWebsite } from 'lib/db';
import { useAuth } from 'lib/middleware';
export default async (req, res) => {
await useAuth(req, res);
const { id } = req.query;
const website = await getWebsite({ website_id: +id });
return res.status(200).json(website);
};