Read the statement by Michael Teeuw here.
Get user input
-
Hi, I’m still pretty new in this node.js topic, but I’m really interesting in adding some modules.
I’m struggling to get user input base on a button in the front-end (not physical button) but I cannot find the solution.
I tried with:// create the server listen: function() { this.expressApp.get('/Button1', function (req, res) { sendSocketNotification('BUTTON1', 'Hello world'); //res.send('Stop signal sent!'); }); },But I got a:
ReferenceError: sendSocketNotification is not defined
or withthis.sendSocketNotificationI got:
TypeError: this.sendSocketNotification is not a functionIs there any way to get the user input?
Thanks!
Note from admin: Please use Markdown on code snippets for easier reading!
-
@veryaner if you want you can have a look in my Module, i did a similar approach, this might get you started.
[card:fewieden/MMM-syslog]
-
Great it worked!!! My mistake was that I was creating the app after a notification and not at the start of my module!
Thanks a lot!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login