Building REST endpoints which call methods


#1

What’s the simplest / lightest weight way to add a simple POST handler on my server?

I have several meteor apps built on 1.3 with React and ReactRouter. I want to build an admin page which lets me do things like flush data from each of my apps. Ideally passing an authorization token in the header. All I want to do is call a method and return “Success” or “Error”.

In a normal Express app I would just do something like
App.post(’/ws/MYFUNCTION’, myFunction(req, res){ … });

I could also build a react route which handles the request and calls a meteor method, but that would be over GET, wouldn’t it? It seems like an uglier solution, but it might be my best bet.

I’ve seen the REST page on meteorpedia, but these solutions seem like they’re overengineering my solution! What is a simple options for me in this case?