I have a method on my server that I want to run from time to time, though not on a consistent schedule or as a response to a specific event, and would trigger it manually. I can easily ssh
into the server, cd
into the directory, uncomment the function call, run the code then comment the function call out again, though it can be a bit tedious. I was wondering if it would be bad practice to expose it as a REST API endpoint and just run it from there whenever necessary instead. Any and all advice and suggestions would be helpful.
Asked
Active
Viewed 42 times
0

Sebastian Simon
- 18,263
- 7
- 55
- 75

Sal
- 1,471
- 2
- 15
- 36
-
HTTP services are meant to respond some data for more than one consumer. In your case, you are expecting only one consumer to call the server with an intention to trigger something. Why not use RPC – codetiger Jun 24 '20 at 05:35
-
I'm not familiar with RPC, would you mind explaining how it works? – Sal Jun 24 '20 at 05:43