0

How to run new project in Google Cloud Platform using Node js without run commands again and again for run file in Google Cloud Shell

  • what do you want to do? Can you please explain briefly? – deepchudasama Dec 25 '18 at 12:06
  • @deepbchudasama Sorry i'm wasting your time but i get the solution for my problem .But i have get the new problem Cloud Sql query is not working after deploy project . – shivani chourasiya Dec 25 '18 at 13:38
  • No you aren't wasting my time :) Feel free to share your problem regarding SQL Query. – deepchudasama Dec 25 '18 at 16:09
  • I have seen your recent questions you seems like new in Web Development! – deepchudasama Dec 25 '18 at 16:11
  • @deepbchudasama thank you so much and i'm not new in Web Development but i'm learning a new programming languages. So i have facing some issues. – shivani chourasiya Dec 26 '18 at 05:42
  • @deepbchudasama i have run gcloud app deploy command in Google Colud Shell but i think this is not connect Cloud MySQL . How can i check this is connect or not to Cloud MySQL. I have some changes in code and run this command my html is working properly but where i'm using query is not working – shivani chourasiya Dec 26 '18 at 06:05
  • @deepbchudasama why these command run again and again in shell. I have seem like this error Error connecting: Error: connect ETIMEDOUT at Connection._handleConnectTimeout (/home/shivanichourasiya82/nodejs/node_modules/mysql/lib/Connection.js:411:13) if these command is not run again and again – shivani chourasiya Dec 26 '18 at 06:10
  • @deepbchudasama how i am connect node js to Cloud MySQL permanently.So i can not get the error again – shivani chourasiya Dec 26 '18 at 06:14
  • Probably you have problem with your connection and with **node.js** you have to work with asynchronous operations so, try this: https://stackoverflow.com/a/40868716/8348558 – deepchudasama Dec 26 '18 at 07:26

1 Answers1

0

You can install a supervisor module as explained in the StackOverflow answer.

To install the supervisor module run below command:

npm install supervisor -g

And then run you application with the command:

supervisor -e html,js app.js

This will monitor all .html and .js files for any changes and update the content of your web pages without a restart of application. Of course, You will need to reload the web page.

Omair
  • 481
  • 3
  • 6
  • I'm run deploy command in Google Cloud Shell and run the project url in the browser https://[PROJECT-ID].appspot.com. But i have get error 502 in node js api response – shivani chourasiya Dec 26 '18 at 12:15
  • This 502 error can be caused by a number of reasons. You will have to check your logs for detailed message. Check your logs in Stackdriver and see the StackOverflow answer that explains how to get nginx logs [here](https://stackoverflow.com/a/38021633/10553701) – Omair Jan 01 '19 at 19:30