Multiple web in one domain - reactjs

I'd like to host three react web sites in one domain. But each web is heavy.
I've heard about the subdomain and subdirectories, but is this done in one file? Or does that mean I'll combine them at hosting stage? (npm start 3 times)

You can make sub domains and point to specific directories of your website
as api.domain.com points to one directory, dashboard.domain.com points to another directory and redirects to the specific site.
Or you can make one directory and place your websites in sub directories and can access them as domain.com/site1 , domain.com/site2 respectively.
How to create a subdomain and point to a certain directory

What you're looking for are sub domains, eg:
site1.yourdomain.com
site2.yourdomain.com
site3.yourdomain.com
Each subdomain has a different directory on your web server, or can even point it to another server. You can look into CI/CD to help automate your build and deployment process.
How to create subdomains
CI/CD Example With Docker

Related

What is the easiest way to push a file on the GCP AppEngine?

To verify the ownership of a domain to a mail service, I need to put a file with a specific name for verification. Is there a better way than pushing it into my app source repository?
For security reasons you would have to put the file in your source and do a deployment to App Engine. If you’ve worked with a traditional web server in the past where you basically dump files into a folder and serve them this will be a bit of a change. The App Engine files are going to execute only. If you want to get in to adding other files on the fly you would need a Cloud Storage Bucket, but I don’t think that will do it for your domain verification.

can i make a subdomain to point a different app in GAE?

i am a newbie to Google app engine web application.there are two seperate gae web applications in which one application intended for staging and the other application used for live production purpose.we bought a domain for eg: example.com which we point to staging as
www.staging-example.com(it is working fine). what i want to do is that with the same domain name can i make it to point to the live production app like for eg: www.live-example.com. is it possible?.if its possible please tell me how?. your answers will be very appreciable.
thanks in advance
Please be aware that www.staging-example.com and www.live-example.com are two completely different and independent domains apart from the fact that they are both .com domains.
Since app engine does not support naked domain redirection with SSL (staging-example.com, live-example.com would not work with SSL) you have to use subdomains anyway, like staging.example.com and live.example.com.
And yes that is possible and basically the exact same steps for each app. Since you set that up for your staging domain this should be a piece of cake for you. The steps are described in here, but the highlights are:
Create a CNAME record for your subdomain which points to ghs.googlehosted.com
Add the custom domain in your apps project custom domain settings.

Laravel and AngularJS in Homestead

I want to get started with Homestead for my project. This is an existing project, and it works when using a standard WAMP stack.
I use backend and frontend as separate applications, but on the same domain, like this:
Laravel as rest backend at url homestead.app/api/public.
AngularJS as frontend at url homestead.app/client.
I have mapped my homestead.app site to /home/vagrant/project1, where the two folders api and client are located.
When trying to access homestead.app/api/public I got the Laravel welcome page. So far so good. But when trying homestead.app/api/public/user/info, the nginx log says /home/vagrant/project1/index.php is missing. But this is wrong, since the file is located at /home/vagrant/project1/api/public/index.php.
Any advice on how to be able to use homestead for my approach?
Seems like a good scenario to use a separate subdomain for the API (api.homestead.app), or just a different domain altogether.
Check out the section "Adding additional sites" in the documentation:
Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your Homestead.yaml file and then run homestead provision or vagrant provision.

Running Multiple Google App Engine Apps from one Domain

I would like to have the following:
myrootsite.appspot.com
myrootsite.appspot.com/app1
myrootsite.appspot.com/app2
etc.
Is this possible? I know I could just make /app1 be handled by app1, but then the redirects and everything wouldn't work unless I explicitly used redirect('/app1') instead of the current redirect('/').
Is there a way I can just upload my current apps (app1, app2, etc.) to the root site and have them work regularly?
Thanks in advance
You can only have one application per site. This means you'll need:
app1.appspot.com
app2.appspot.com
You can register one App Engine application ID and have each subdirectory do different things. For example, have all URLs under /app1 do one thing, and all URLs under /app2 do another thing.
However, they'll have to be deployed together, and will eat away at the same quota. They will, in fact, be one application, with URLs that do two completely different things.
Otherwise, what Taylor says is correct, you can only have separate subdomains (either on appspot.com or as subdomains on your own domain)
You can't have multiple apps on a domain without a reverse proxy - but you can have multiple 'subapps' - just configure each one independently using app.yaml / web.xml. They'll share the same datastore and memcache, but otherwise can be treated as separate components.

deploy multiple appengine apps to one appspot subdomain

I don't want to waste any more of my 10 appspot.com subdomains for test projects. Is there an elegant way to have multiple appengine apps, each to its own folder, e.g. xx.appspot.com/myapp1, xx.appspot.com/myapp2? I want the configuration to be identical or very close to the actual deployment configuration at a subdomain's root.
Just ask for more apps. Google would rather give you more apps than have you work around the limit. See here
What you could maybe do is (ab-)use the different versions for completely different projects. In this case you do not have to change anything in web.xml.
http://1.latest.xx.appspot.com for myapp1
http://2.latest.xx.appspot.com for myapp2
They do share the same datastore and memcache and task queues, but you would have the same situation with separating the paths. And if the table names do not collide, that should not be a problem.
You do get different admin consoles (log viewers etc) for each version.
You could always create a new Google account and get 10 new apps, right?
You could use dummy Google accounts for your test projects, and add your original Google account as a developer to a project you decide to actively work on... That way your original Google account doesn't get "polluted" by test projects.

Resources