umami/pages/api/website.js

13 lines
275 B
JavaScript
Raw Normal View History

2020-07-28 08:52:14 +02:00
import { getWebsites } from 'lib/db';
import { useAuth } from 'lib/middleware';
export default async (req, res) => {
await useAuth(req, res);
const { user_id } = req.auth;
const websites = await getWebsites(user_id);
return res.status(200).json({ websites });
2020-07-28 08:52:14 +02:00
};