3 ms·
Ask HN: Should I run an API and client on the same server?
Forgive my ignorance, I only work with an internal API at work and I interface with it on different servers via authentication.
I found this repo (https://github.com/miguelgrinberg/REST-tutorial) and the code creates a Python server for delivering a REST API. It looks like the client is designed to run on the same server this API would be on.
So, what are your recommendations? I want to release some apps this year, and two of them rely on an API that I will learn how to write.
- mtmail 11y agorest-server.py uses the flask framework which just happens to default to localhost:5000. You can run it on any IP address or domain, see http://flask.pocoo.org/docs/0.10/deploying/#deployment http://flask.pocoo.org/docs/0.10/deploying/#deployment Questions of the kind "how to I do X in programming language Y" are better answered on stackoverflow.
- NetOpWibby 11y agoSO was actually my initial thought, but I seem to get a bunch of downvotes on those kinds of questions, and comments telling me to go to some other StackExchange site to ask that question. Thanks for your response though!
- mod 11y agoIt's fine to do that, just compose them in a way where it wouldn't matter if it were another server. That way it's easier to migrate off later, if needed, and easier to scale as well.
- NetOpWibby 11y agoHmm, okay. Thanks!