Chart component. Update web utils.
This commit is contained in:
10
pages/api/website/[id]/pageviews.js
Normal file
10
pages/api/website/[id]/pageviews.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { getPageviews } from 'lib/db';
|
||||
|
||||
export default async (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 });
|
||||
};
|
||||
Reference in New Issue
Block a user