Aiohttp web server as virtualhost? - aiohttp

It is necessary to add to the aiohttp Web server to support multiple domains. Possible routes to bind to domains? I would be grateful for an example.

aiohttp is an HTTP client/server library for python, and not a standalone product. Applications built with aiohttp should probably be served behind a reverse proxy (such as nginx) that easily handles configuration options such as multiple domains/virtualhosts and much much more. Refer to aiohttp's deployment documentation for more info.

Related

How to use Hsytrix to be the gateway for multiple webapps

We have many web apps deployed in tomcat container. All these applications, make REST API calls to a couple of external services. What we want is all these rest API calls (across these web apps) to be going via single Hystrix gateway so we can build resiliency into the system. Any idea how to do this? If these independent web apps package hystrix in their own war then there will be multiple hystrix instances created? How to have a single instance of Hystrix per JVM which should deal with multiple web apps ?
Thanks,
Sidd
You need a gateway that will serve as a reverse proxy to dispatch incoming requests to the different services. This gateway can implement hystrix commands in order make the calls to the different external services.
Look at Zuul made by Netflix it's the most popular choice in terms of gateways. Hystrix is already in place and wraps the different external calls. You can also use spring cloud Netflix which includes an embedded Zuul proxy, here's an example: https://spring.io/guides/gs/routing-and-filtering/

Do I need Nginx alongside nodejs in production (using Firebase for hosting and database)

I have the below configuration
Firebase - for hosting (serving static files) and storing data
(Database).
Nodejs - for making API calls to Firebase, Twilio and Sendgrid.
Angularjs - for frontend
Do I need Nginx for the above configuration ? looking at answers like these makes me consider Nginx.
My app is intended to serve several hundred users.
No, you do not NEED nginx. There are zillions of node.js apps at the scale you describe that do not need to use something like nginx.
You would use Nginx if you had a specific problem in your deployment and Nginx was the easiest/best way to solve that problem. You have not described any specific problem (other than scaling to a few hundred users which node.js can do just fine by itself) so you have not described any reason that you need Nginx.
Nginx has a bunch of things it is great at, but until you identify a specific need for more than node.js offers, I would not recommend that you complicate your deployment just because Nginx helps some people. Instead, deploy your app, measure its performance, understand where your weaknesses are and then evaluate if Nginx is the best tool to help you fix any weaknesses that need fixing.

Enable CORS with Hazelcast

I am currently using Hazelcast to expose a RestAPI for an Angular Client.
Is there any way to allow CORS on our Hazelcast server ?
I can't find anything about that in their documentation.
Hazelcast is not designed to be exposed to the Internet, that said the REST API is not designed to be used by web applications directly. If you use node.js you might consider using the node.js client.
To answer the question itself: CORS is not supported for the reason stated above.

Loopback is Baas or mBaas?

I am building a api on loopback. I was curious if loopback is a Baas or a mBaas framework. What I mean is will I face any problem if I would use it for my website builded in angularjs?
Will my api handle about 300req/s for all my requests?
Loopback is mostly a generalized Baas framework. One of it's use cases is web applications that uses angularjs. I actually do use loopback as a backend for a Angular.js webapp.
Yes mostly, but that depends on your business logic, your servers, databases, server load and a lot of other factors.
Loopback builds an http rest API that can get connected to databases or other rest or soap backends. It also has a few clients libraries, which includes plugin for angular resource. You can also write your own connectors or client library.

Google App engine for mobile clients

Can I use GAE(Google App Engine) for developing a server for mobile clients? Mobile clients will send data to server every 10 seconds.
I am planning to develop the prototype using GAE and then depending on the results, will decide where to locate the prod server.
And are there any best practices to follow in developing code so that it will have very minimal dependancy with GAE (Can easily port to another environment with minimal code change when required)
thanks.
Ofcourse you can, GAE provides a good way to create a great backend for a mobile app.
about dependencies, you can use a project like django-nonrel, it creates an interface between your code and the API of GAE.

Resources