jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

is there a way to change the "success" message after each action #761

Closed sw764206 closed 3 years ago

sw764206 commented 4 years ago

is there a way to change the "success" message after each action and modify the code so that it doesn't open that message and possible redirects back to a specific URL (the URL of my home dashboard on my wall panel?)

jishi commented 4 years ago

The code responsible for the response is this:

https://github.com/jishi/node-sonos-http-api/blob/master/lib/sonos-http-api.js#L102

You would have to modify that to instead send a 302 statusCode, and a Location: header pointing to your dashboard.

jishi commented 4 years ago

Actually, it's this piece

https://github.com/jishi/node-sonos-http-api/blob/master/lib/sonos-http-api.js#L84-L90

But you would have to deal with errors (e.g, a 500 code) somehow.