How to deploy create-react-app to Google Cloud - reactjs

I have a frontend create-react-app and a backend API using Expressjs.
I deployed the backend API to Google App Engine successfully.
But now I need to deploy the create-react-app to Google Cloud and it becomes very confusing, I tried to google for a while and there is no true/recommended way for this.
At least I saw that other people suggested doing it in 2 ways:
Using Google Cloud Storage:
Run "npm run build" to create the "build" folder
Upload this whole folder onto a bucket
=> I see that there is one drawback using this way: When I tried to reload page 'url/aboutUs', it's not found. So I have to go back to 'url' then click the About Us link
=> I guess that the React Router that I'm using is not working with Google Cloud Storage
Using Google App Engine
=> People just talked about using it, but I can't find any guide/tutorial for this.
So what is the recommended way to deploy create-react-app to Google Cloud?
And can you please provide a tutorial for that?
Thanks.

You just need to configure the Cloud Storage bucket to serve index.html as the 404 page.
For Google App Engine, you can use serve or set up nginx to serve index.html in the build folder.

Related

Deploying Next Js application to Firebase Hosting

I selected '.next' folder as the public folder and gave firebase deploy command. The deployment was completed successfully however my website is not being shown. What could be the reason? How should I deploy Next Js application to Firebase Hosting?
As far as i know Firebase hosting is for static sites. If you use SSR its not possible (or very hard) to deploy Nextjs app.
If you only use SSG from next and get build with command "next export" that is should be easy to deploy this build folder which should be called 'out'.
more info here https://nextjs.org/docs/advanced-features/static-html-export

deploy multiple enpoint api google app engine

I have 2 json files, I want to deploy on GCloud
With this command:
gcloud endpoints services deploy first_file.json
gcloud endpoints services deploy second_file.json
But after second file deploys the first one is removed.
Why?
If both files are for the same service you should check this documentation on how to deploy configuration files. You might be also having some issues with naming, as described in the description of the gcloud endpoints services deploy page.
Besides that, here you'll find tutorials on how to configure Endpoints on App Engine Standard.
If this is not the case, please add more information to the question, such as what is your use case and some code if possible.

Deploy and download a wordpress application to google compute engine

How to deploy a local wordpress instance to google compute engine and download the same. I manage to deploy to google app engine, looking around for the document to deploy to google compute engine and download the same. With the existing post I can see its defn possible, but not able to locate the right document.
Also is it possible to deploy using gcloud commands ?, what is the command to use ?
I tried this command gcloud preview app deploy app.yaml but it keep complaining [application] is not used by gcloud. When I remove this tag, it keeps complaning endlessly. Is there a different app.yaml structure for compute engine and app engine.
How can I generate app.yaml file that is compatible with compute engine ?. Can it be downloaded some where or using a gcloud command ?, gcloud config doesnt seem to generate one.
We just finished working on a tool and guide to help do exactly what you're asking:
https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/appengine/flexible/wordpress
Let us know if you run into any issues!

mirror-api java quick start project deploy to app engine

can anyone help me as to how to deploy the mirror-api java quick start project to google app engine? I have imported the project into Eclipse via the maven import and made the war file: mvn war:war
I am able to run it locally without any problems
dont know how to deploy to app engine, I have created an appspot project inside google app engine as well
check it out https://github.com/googleglass/mirror-quickstart-java/tree/app-engine
there's a tag on official repo!

Uploading app on google app engine

I am new to python and google app. I have an already created application in python and
google app engine. I have downloaded source code of the app and customized it. The source
code which i downloaded doesn't have app.yaml and index.yaml in it. Now i want to know that if i upload my app on google app engine without app.yaml and index.yaml then is there any chance that my data on live server get lost. Please show me right path i am doing any
thing wrong. Also i dont know how to upload a single file on google app engine. Should i have to upload whole app ?
i have used following command for downloading source code on localhost:
appcfg.py download_app -A <your_app_id> -V <your_app_version> <output-dir>
You cannot upload an application without an app.yaml. The app.yaml file contains the necessary configurations to run your application like handlers to use, application ID, runtime, and so on.
Also, you cannot upload a single file to App Engine, you always upload the entire app.
I strongly suggest you do the "Getting Started" guide:
https://developers.google.com/appengine/docs/python/gettingstartedpython27/
before you invest more time in trying to figure out why things don't work.

Resources