Skip to content

Commit 87ec2b4

Browse files
committed
Fix url /vi should be /v1
Add `env` via options rather than local variable
1 parent b485134 commit 87ec2b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ function sendRequest(namespace, text, level='INFO', options={}) {
2727
console.error('PushNotice: level has to be provided');
2828
return;
2929
}
30-
if (options.url == undefined) options.url = 'https://pushnotice.chat/api/vi/chatnotice';
30+
if (options.url == undefined) options.url = 'https://pushnotice.chat/api/v1/chatnotice';
3131
if (options.debug == undefined) options.debug = false;
32+
if (options.env == undefined) options.env = undefined;
3233
let requestOptions = {
3334
method: 'POST',
3435
uri: options.url,
@@ -38,7 +39,7 @@ function sendRequest(namespace, text, level='INFO', options={}) {
3839
namespace: namespace,
3940
level: level,
4041
text: text,
41-
env: env,
42+
env: options.env,
4243
},
4344
json: true,
4445
headers: {

0 commit comments

Comments
 (0)