mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 16:17:13 +01:00
Enable public website sharing.
This commit is contained in:
parent
48a524e09c
commit
560f1316c1
36 changed files with 294 additions and 61 deletions
18
pages/api/share/[id].js
Normal file
18
pages/api/share/[id].js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { getWebsiteByShareId } from 'lib/queries';
|
||||
import { ok, notFound, methodNotAllowed } from 'lib/response';
|
||||
|
||||
export default async (req, res) => {
|
||||
const { id } = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const website = await getWebsiteByShareId(id);
|
||||
|
||||
if (website) {
|
||||
return ok(res, website);
|
||||
}
|
||||
|
||||
return notFound(res);
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue