- Google Cloud Platform Cookbook
- Legorie Rajan PS
- 265字
- 2021-08-27 19:13:24
How to do it...
With the MongoDB server up and running, we'll make a few configurational changes and deploy the application to the App Engine:
- Logging into the Cloud Platform Console, create an App Engine application, select the region where the application will be hosted and enable billing. You can follow along with the interactive tutorial provided by Google to host your first Node.js application to the App Engine.
- In the development machine, copy the Chapter01/mysite folder to a new folder called Chapter01/mysite-ae from where we'll push the code to the App Engine:
$ cp mysite/ mysite-ae/ -r
- Navigate to the mysite-ae folder. Open the .env file and update the path for MONGO_URI to point to our VM:
MONGO_URI=mongodb://<External IP>:27017/mysite
- Verify that all the packages are installed and launch the application on the development machine, pointing to the database on the Cloud:
$ npm install $ npm start
- The application's configurations are governed by a file called app.yaml. Create a new file with the following content:
# Basic configurations for the NodeJS application runtime: nodejs env: flex
- Now, we can deploy the application to the App Engine:
$ gcloud app deploy
- Once the application is deployed, the URL to access the application is provided. Fire up your favorite browser and navigate to the appspot URL and verify that the KeystoneJS application is running properly:
.....
5cbd6acfb] to complete...done. Updating service [default]...done. Deployed service [default] to [https://<project-id>.appspot.com]
- You can stream logs from the command line by running:
$ gcloud app logs tail -s default
- To view your application in the web browser run:
$ gcloud app browse
推薦閱讀
- Mastering Mesos
- Ansible Quick Start Guide
- Cloud Analytics with Microsoft Azure
- Effective DevOps with AWS
- DevOps:Continuous Delivery,Integration,and Deployment with DevOps
- 具比例時(shí)滯遞歸神經(jīng)網(wǎng)絡(luò)的穩(wěn)定性及其仿真與應(yīng)用
- Hadoop應(yīng)用開發(fā)基礎(chǔ)
- HTML5 Canvas Cookbook
- 學(xué)練一本通:51單片機(jī)應(yīng)用技術(shù)
- 單片機(jī)技術(shù)項(xiàng)目化原理與實(shí)訓(xùn)
- Learning Linux Shell Scripting
- 會(huì)聲會(huì)影X4中文版從入門到精通
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- 無人駕駛感知智能
- 大數(shù)據(jù):從基礎(chǔ)理論到最佳實(shí)踐