mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
19 lines
386 B
JavaScript
19 lines
386 B
JavaScript
|
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);
|
||
|
};
|