项目作者: signtomonika

项目描述 :
Rest Api Using Google Cloud deployed in App Engine
高级语言: JavaScript
项目地址: git://github.com/signtomonika/MySql-GCP.git
创建时间: 2018-11-28T22:51:05Z
项目社区:https://github.com/signtomonika/MySql-GCP

开源协议:

下载


REST API USING GOOGLE CLOUD MYSQL

This is Sample Application for using GCLOUD MySQL in NodeJS Application and deploying it to App Engine

Contents

Prerequisites

  • GCLOUD Instance Creation

  • Connect to the Server from MySQL Workbench or any MySQL Client

  • Run the scripts classicmodels.sql and classicmodelsTest.sql from client

  • Configure NodeJS Application to use GCLOUD MySQL

    • Create file config.json in the below format in “Root” folder

      1. {
      2. "MYSQL_USER": "server user name",
      3. "MYSQL_PASSWORD": "password",
      4. "HOST_NAME": "ip address",
      5. "DATABASE_NAME": "database name"
      6. }

Local Run :computer:

  1. $npm start

OR

  1. $node server.js

OR

  1. $nodemon server.js

Open Link http://localhost:8080/

Testing :thumbsup:

  1. $npm test

OR

  1. $npm run test-watch

Open Link http://localhost:8080/

GCLOUD Deploy

  • Follow Steps to deploy the application
  • Create config.json file in the root folder with contents from local
  • run console gcloud app deploy