dev to main - v0.1.2 #4
@@ -6,7 +6,8 @@ export async function sendNotification(title: string, body: string, link?: strin
|
||||
link
|
||||
}
|
||||
});
|
||||
const response = await fetch("http://apprise:8000/notify", {
|
||||
if ( ! ( process.env.notification_mock == "true" ) ) {
|
||||
const response = await fetch(`${ process.env.apprise_https == "true" ? "https" : "http"}://${process.env.apprise_host ? process.env.apprise_host : "apprise"}:${process.env.apprise_port ? String(process.env.apprise_port) : "80" }/notify"`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
@@ -23,4 +24,10 @@ export async function sendNotification(title: string, body: string, link?: strin
|
||||
});
|
||||
const responseBody = await response.json();
|
||||
return responseBody;
|
||||
} else {
|
||||
console.dir({
|
||||
sendNotification: "mocking"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user