mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 01:35:17 +01:00
14 lines
348 B
JavaScript
14 lines
348 B
JavaScript
import { getPageviews } from 'lib/db';
|
|
import { useAuth } from 'lib/middleware';
|
|
|
|
export default async (req, res) => {
|
|
await useAuth(req, res);
|
|
|
|
console.log(req.query);
|
|
const { id, start_at, end_at } = req.query;
|
|
|
|
const pageviews = await getPageviews(+id, new Date(+start_at), new Date(+end_at));
|
|
|
|
res.status(200).json({ pageviews });
|
|
};
|