mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Collection API.
This commit is contained in:
parent
f7f0c05e12
commit
11f1afe5c3
9 changed files with 400 additions and 64 deletions
|
|
@ -4,7 +4,7 @@ import { savePageView } from '../../lib/db';
|
|||
export default async (req, res) => {
|
||||
const values = parseCollectRequest(req);
|
||||
|
||||
if (values) {
|
||||
if (values.valid) {
|
||||
const { type, session_id, url, referrer } = values;
|
||||
|
||||
if (type === 'pageview') {
|
||||
|
|
@ -12,5 +12,5 @@ export default async (req, res) => {
|
|||
}
|
||||
}
|
||||
|
||||
res.status(200).json({ status: 'ok' });
|
||||
res.status(200).json({ status: values.valid });
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ export default function Home() {
|
|||
return (
|
||||
<Layout>
|
||||
Hello.
|
||||
<br />
|
||||
<a href="/?q=abc">abc</a>
|
||||
<br />
|
||||
<a href="/?q=123">123</a>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue