mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Add Gotify Service
This commit is contained in:
parent
e3237b9022
commit
5e6312fe93
15 changed files with 95 additions and 4 deletions
|
@ -12,6 +12,7 @@ const formats = {
|
|||
jellyseerr: `{url}/api/v1/{endpoint}`,
|
||||
ombi: `{url}/api/v1/{endpoint}`,
|
||||
npm: `{url}/api/{endpoint}`,
|
||||
gotify: `{url}/{endpoint}`,
|
||||
};
|
||||
|
||||
export function formatApiCall(api, args) {
|
||||
|
|
|
@ -8,15 +8,19 @@ export default async function credentialedProxyHandler(req, res) {
|
|||
if (group && service) {
|
||||
const widget = await getServiceWidget(group, service);
|
||||
|
||||
var headersData
|
||||
if(widget.type == "gotify"){
|
||||
headersData = {"X-gotify-Key": `${widget.key}`,"Content-Type": "application/json",}
|
||||
}else{
|
||||
headersData = {"X-API-Key": `${widget.key}`,"Content-Type": "application/json",}
|
||||
}
|
||||
|
||||
if (widget) {
|
||||
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
||||
const [status, contentType, data] = await httpProxy(url, {
|
||||
withCredentials: true,
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"X-API-Key": `${widget.key}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers: headersData,
|
||||
});
|
||||
|
||||
if (contentType) res.setHeader("Content-Type", contentType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue