question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updateCurrentState - add URL request option

See original GitHub issue

Hi, it would be great if you can expand a “updateCurrentState” method with ability to call URL on state change. I’ve an alarm system, which I can trigger with URL link. What I want to do is to call “alarm on” URL when alarm is triggered and “alarm off” URL when alarm is disabled. For URL request you could use something like:

var url = require('url');
...
    this.alarmOnUrl = url.parse(config['alarmOnUrl']);
...
 request({
           url: me.alarmOnUrl,
           method: 'GET',
       }, 
       function (error, response, body) {
       if (error) {
           // me.log('STATUS: ' + response.statusCode);
           // me.log(error.message);
           return callback(error);
       }

There should be option to define(optional) URL for every state (armed, triggered, …).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
0ldF0xcommented, Mar 30, 2019

Works perfect! Thanks for the quick implementation.

0reactions
MiguelRipoll23commented, Mar 30, 2019

You’re welcome! Feel free to follow-up this issue if there’s anything regarding this feature that could be improved or fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >
Why am I getting an OPTIONS request instead of a GET ...
it does an OPTIONS request to that URL, and then the callback is never called with anything. When it isn't cross domain, it...
Read more >
got/2-options.md at main · sindresorhus/got - GitHub
The HTTP method used to make the request. The most common methods are: GET , HEAD , POST , PUT , DELETE ....
Read more >
HTTP | Node.js v19.3.0 Documentation
To get the response, add a listener for 'response' to the request object. 'response' will be emitted from the request object when the...
Read more >
HTTP/1.1: Method Definitions
The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found