mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 14:58:47 +00:00
Enhancement: multiple widgets per service (#4338)
This commit is contained in:
parent
385511f773
commit
907abee1aa
46 changed files with 210 additions and 169 deletions
|
@ -9,8 +9,8 @@ const logger = createLogger("servicesProxy");
|
|||
|
||||
export default async function handler(req, res) {
|
||||
try {
|
||||
const { service, group } = req.query;
|
||||
const serviceWidget = await getServiceWidget(group, service);
|
||||
const { service, group, index } = req.query;
|
||||
const serviceWidget = await getServiceWidget(group, service, index);
|
||||
let type = serviceWidget?.type;
|
||||
|
||||
// exceptions
|
||||
|
@ -41,7 +41,7 @@ export default async function handler(req, res) {
|
|||
const endpoint = mapping?.endpoint;
|
||||
const endpointProxy = mapping?.proxyHandler || serviceProxyHandler;
|
||||
|
||||
if (mapping.method && mapping.method !== req.method) {
|
||||
if (mapping?.method && mapping.method !== req.method) {
|
||||
logger.debug("Unsupported method: %s", req.method);
|
||||
return res.status(403).json({ error: "Unsupported method" });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue