This is Sample Application for using GCLOUD MySQL in NodeJS Application and deploying it to App Engine
-
GCLOUD Instance Creation
- Create Second Generation Instance. Refer Documentation
-
Connect to the Server from MySQL Workbench or any MySQL Client
- Get Public IPv4 Address Here
- Configure Gcloud Connection. Refer Documentation
- Use
Connect To Instance
details present in GCLOUD MYSQL Instance Detail to connect to server via client
-
Run the scripts
classicmodels.sql
andclassicmodelsTest.sql
from client -
Configure NodeJS Application to use GCLOUD MySQL
-
Create file
config.json
in the below format in "Root" folder{ "MYSQL_USER": "server user name", "MYSQL_PASSWORD": "password", "HOST_NAME": "ip address", "DATABASE_NAME": "database name" }
-
$npm start
$node server.js
$nodemon server.js
Open Link http://localhost:8080/
$npm test
$npm run test-watch
Open Link http://localhost:8080/
- Follow Steps to deploy the application
- Create config.json file in the root folder with contents from local
- run
console gcloud app deploy