[Node.js] 遠端關機 RESTful API

因為太懶了,所以想在床上關電腦

npm install -g stop-server

自動執行

C:\Users\用戶\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\啟動\stop-server.vbs

Set objShell = CreateObject("Wscript.Shell")
objShell.Run "node C:\Users\用戶\AppData\Roaming\npm\node_modules\stop-server\index.js", 0

用IoT按鈕就可關機

POST http://your-local-ip:5709/power-off

下載Bonjour Print Services,可以把ip變成 pc-name.local

https://support.apple.com/kb/DL999?locale=zh_TW