Uploading Angular 2 app to web hosting - laravel

So far I've used web hosting such as https://uk.godaddy.com/hosting/web-hosting for my websites, but seem like running angular 2 app has different way for publication.
So, since I found nothing about running Angular 2 app to be available public, and not only in localhost
My questions are -
What providers do allow such apps to be hosted on them? now I'm using npm start in my project folder to run my app, does it works the same way?
Since my backend is Laravel and supposed to be in the same domain as the Angular2 frontend, These providers allow to host the API's too?
Thanks in advance!

I have also hosted my laravel backend and angular front end using openshift. In terms to your application, I recommend you the following two providers.
Amazon Web Service. You can get 1 year free trial, EC2 is really wonderful to host whatever you want. In EC2, you can configure the environment for angular 2 and laravel by yourself. You can run any command including npm install in EC2
Openshift. You can freely create 3 gears to host your application. The environment is very easy to configure. If you want
to deploy angular 2, laravel applications, there are specific gears for these frameworks, so openshift
should be the best choice.
The answer to your second question : Yes, they allow to host the APIs !

Related

Blazor PWA Offline Caching while deployed to a Subdirectory

I followed this Blazor PWA Guide in order to create a PWA. This works seamessly when I deploy it directly under my site (or subdomain) such as https://example.com or https://myapp.example.com
However, I want to host this under an IIS subdirectory such as https://example.com/myapp
Problem now is that the service worker doesn't seem to correctly cache/load the assets while doing this. I have been trying to figure out what I should change in the service worker in order to make the cache work but can't get it right.
The service worker I am using is the one that comes with the blazor wasm template, which can be found here
How can I edit the service worker to work under a subdirectory?

how heroku, netlify, godaddy are different in terms of the web hosting service it provides

If I want to have a react app hosted on my owned domain what is my best option ?
1) Godaddy webhosting
2) heroku
3) netlify
I not sure what are the differences, what shoud I choose, I want CI/CD to be setup and, each push to my repo on github should trigger a deployment
Heroku and Netlify have good CI/CD support. With Netlify you are more limited since they host static web pages. You cannot do SSR (server side rendering) with Netlify.
It depends entirely on your project. If you have a project that requires SSR go for Heroku. If you have a project that is a SPA go for Netlify. When combined with GitHub it can be especially nice.

Run two apps on one heroku domain

I have two apps, one is a react app being served on a node server (front end). Another one is a Spring boot app (backend that provides bunch of REST API endpoints). They live on two different github repos.
Is there a way to configure heroku to serve both of them (they run on different ports) on one domain?
Right now, I have the java spring boot app being served on one heroku domain, I want the second react project to build and run on the same domain. Any idea ?

Webserver for Angular and Spring application

I'm building a small web application for a personal project. It will be an Angular web application which will talk to a Spring-Boot service layer which in turn will read/write stuff to MongoDb.
I hope to host all this on a single EC2 instance in AWS. My question is how to configure a web server (like Apache but doesn't have to be) to 'beautify' the URLs a bit. Example, without touching anything angular will run at something like host:4200 and the service layer at host:8080. I will then have to map a proper domain to host in AWS, but the hiding of ports etc is where it gets murky for me.
I want to be able to hit my web app at domain.com (no ports etc) and I also want my service layer to ideally have a similar setup e.g. domain.com/service (no ports etc).
How do I configure a webservice to do this for me? Examples or pointers to specific examples would be ideal, but even a pointer to the right documentation will be helpful.
This thread is kind of similar to what I want but not too helpful: How to deploy Spring framework backend and Angular 2 frontend application in any online server?
You can use a setup with AWS CloudFront as reverse proxy and CDN cache. You can map the Domain Name and SSL Certificates(You can use AWS issued free SSL Certificates through AWS Certificate Manager) to CloudFront while the EC2 instance is plugged as an origin behind CloudFront as shown in the following diagram.
In the diagram I have optionally added, which is a common practice in designing applications in AWS.
Hosting the Angular App in S3
Using Autoscaling & Loadbalancing for EC2 instances.
You need to use Apache or other web server as a reverse proxy. Start here -
https://devops.profitbricks.com/tutorials/configure-apache-as-a-reverse-proxy-using-mod_proxy-on-ubuntu/
You then will need to setup a custom domain name. The easiest option is to just use an ELB (now called Classic Load Balancer). More details are here -
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html

Hosting a Web Application

I have a quick question regarding hosting web applications. I've recently started getting into hacking so I just wanted to understand them a little more.
I am aware that to host websites you need to pay for a domain name, as well as a hosting service. So let's say you buy a domain from GoDaddy, and then you buy hosting from Dreamhost.
Let's say I'm making a web application in Node.js, then I need to buy a cloud platform such as heroku, correct?
So do I need to buy a domain, hosting service, AND a cloud platform in order to launch a web application?
Cloud hosting is just another kind of hosting versus stuff like Dreamhost.
You likely can't run something like Node.js on Dreamhost's shared hosting, but you could on one of their VPS/dedicated servers. Heroku's just easier for that sort of thing. You'd in most cases pick either Dreamhost or Heroku, not both.

Resources