Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change post to get by default #12

Open
Leninsky opened this issue Apr 18, 2016 · 1 comment
Open

Change post to get by default #12

Leninsky opened this issue Apr 18, 2016 · 1 comment

Comments

@Leninsky
Copy link

Leninsky commented Apr 18, 2016

This application is awesome, now I am thinking about using it with an ESP8266 to check whether I am in the bed and automatically put my computer after two minutes to sleep if I don't override the function by opening a webpage or don't get off the bed in that time. (check capacitive body sensing on hackaday) Worked out of the box on Windows 10, while Windows 10's automatic sleep refuses to work most of the time.

In the original application I'd just change the app.post to app.get because when I first got this I used it with my phone as a http://ip:port/sleep shortcut and I needed to change the post to get.

I am actually amazed how well this is written for such a simple task and nodejs makes it a breeze to hack. I got a giggle when I saw that just changing .post to .get did the trick.

@derhuerst
Copy link
Contributor

I used it with my phone as a http://ip:port/sleep shortcut and I needed to change the post to get.

I created derhuerst/shutdown-server for this reason.

It uses HTML forms to send a POST request, because POST is both semantically correct and a lot safer from accidental triggering.

Anyway, 👍 for the great idea @typicode!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants