I am new to Angular Js. Following in my scenario.
I have static website.(i.e. pure html pages) deployed on godaddy.
I am developing Angular Js applications.
Angular is calling rest api developed in java.
I have taken aws vpc and deploying rest api on two Wildfly 9.0 server and apache 2.4 as load balancer.
Now I have confusion where to deploy Angular js app.
Whether I should deploy it on godaddy along with my static site(Merge both of them into one).
Whether I should deploy my static site and angular js app (again merge) on apache in aws vpc.
Whether I should deploy angular js app on wildfly server.
Need your suggestion which scenario will be better.
Since you have a static site, you can put it into a S3 bucket and not have to worry about the hassle of a server. This way you don't have to worry about the size of the server or load balancing.
http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
Related
My project contains two apps. Backend – springboot and a frontend - React.
I am using the spring-boot app only as a rest API to fetch data from the database. The React app frontend will call the API. Up until now, we were using only one environment (Windows) so production build was one jar that actually contains both apps and a tomcat. That was quite simple so by adding a proxy in the package.json file to point to the backend and some maven(frontend-maven-plugin) plugin the building process is simple.
Now we need to change the system architecture so each app will be hosts on a different windows machine.
I was trying to use express to host the react app but I am struggling with the proxy setup for the backend (spring) app from the express server. All the tutorials that I found actually using the express server as the backend API but I need the express server only for hosting the production build.
Is there a good tutorial that shows how to set up this type of architecture in production env.
Thank you
I’m new and learning how to deploy to AWS.
I made angular JS website and tried to deploy it at localhost with node.js npm/bower. It’s worked. I tried to deploy it at MS Azure: deployed it from Github and it’s worked as well well (I did not do anything in setting and did not install node.js, but maybe Azure did it automatically?).
The last, I tried to upload it at AWS S3 bucket as a static webpage with allowing public access. It wasn’t work property: I can only see my index.html content but no routing content: so basically almost nothing of my webpage.
I saw a similar question (“How do I set up an AngularJS app using AWS?”) where a person was wonder about options to upload an AngularJS to S3 bucket or EC2. The answer says that one can use S3 at AWS if it's angular js static webpage. The person of that question went for EC2 option. If I’ll go for S3 option: I’m confuse: what is “static Angular js page” actually? will routing work at S3 or I must use EC2 with node.js?
First, you should really do a simple search and read the differences between static and dynamic webpages.
If you are using some sort of server-side technology like NodeJS, Java, Python, Ruby, etc. to generate the HTML for your web pages whenever a request is made then you have a dynamic webpage and you would need to host that on EC2.
If your webpage is simply HTML, CSS and JavaScript files, and the raw content of those files does not changes with each request then you have a static webpage, which can be hosted on S3. The advantages of a static webpage is that it is much cheaper to host, and when hosted somewhere like S3 it can handle massive amounts of traffic without any extra configuration or management on your part.
In your case I believe you are only using NodeJS as a script that you run once to generate/output your static AngularJS content. If that's the case then you have a static website. If however you are also using NodeJS as a server to handle HTTP requests dynamically then you have a dynamic website.
AngularJS is a client-side technology. AngularJS runs entirely in the browser. As such you should be able to host your AngularJS application on S3.
Since AngularJS routing works entirely on the browser side, it shouldn't matter where the page is hosted. You should expect it to work if the page is hosted in S3, since it actually runs in the browser, not the server.
What is “static Angular js page” actually?
Static AngularJS refers to the frontend content such as HTML, JS, CSS, Images & etc. You should be able to implement routing for static content from S3.
Will routing work at S3 or I must use EC2 with Node.js?
If you can separate the AngularJS App Static Content and Backend Code (e.g NodeJS Server Logic with Database access & etc.) then you can host, the AngularJS App in S3 and use EC2 for backend. This can get challenging to setup. To route both to the Frontend in S3 and to the NodeJS backend, in addition you can use AWS CloudFront.
However, since you are new to AWS, it would be better to use either AWS Elastic Beanstalk or EC2 with NodeJS i n the beginning for deployment.
I have an AngularJS app which we need to deploy on production. It also has REST API calls.
As of now for development, we deployed it on AWS EC2 Ubuntu Instance and using grunt serve to run it.
I know grunt should be used only for development, so what are the other ways to deploy Angular App on AWS? I see many answers for deploying it on S3/Cloudfront. Can't we use EC2 instance with Nginx/Tomcat for this purpose on production?
Thanks!
You can setup CloudFront infront of EC2 instance to cache static contents in Angular App, which will improve the application performance better at scale.
If you can clearly seperate the Angular App including the index.html, it is an option to host it in AWS S3 also using CloudFront as a cache and a proxy to your EC2 instance which will reduce the overhead completely on delivering static content from the EC2 instance, further improving the performance. Also you can use S3 to store file uploads.
I'm building an SPA in angular with a web api backend. If I deploy my SPA files to a separate IIS website from my web service then I have to deal with cross domain requests. But if I put everything in one site, then there's no problem. Is there anything wrong with deploying the two to the same site?
No, there is not nothing wrong with deploy all in the same server. If you concern is performance remember optimize your js and css files. Also you can use CDN services to serve your static files.
I have a angular app, just a angular app so no nodejs or other backend is involved. I have a separate backend setup with an API. My angular app communicates to the backend with the API.
Now when I want to put my angular app online, how do I do this? If I just put the html files online I get all kinds of errors (I already have a separate question for this matter, which is unresolved). Deploying to heroku doesn't work because it isn't a nodejs app.
So how is this accomplished?
You can use an apache server or nginx to serve static content on a remote server. Personnaly I use Nginx, it doesn't require a lot of configuration (almost no configuration) to works.