This example assume:
- You have Google cloud function and Google cloud storage enabled.
- You have
gcloud
installed and have already authenticated using the CommandLine.
- npm install.
- Go to .env.yaml and change the
BUCKET_NAME
with your own Google cloud storage bucket name. - Run
npm run deploy
will automatically deploy the function to your google cloud if you havegcloud
enabled on your computer.
Should combine with Google Cloud Scheduler.
- Create a file in root directory called
.env
and put your Google cloud storage bucket name as the following in there:
PROJECT_ID = ""; // yours
BUCKET_NAME = "" // yours
- Download the file from your Google cloud storage containing the credentials and naming it "credentials.json" and put it at the root directory as well.
- Run
npm start
Follow this guide;
Change the helloWorld
in the guide to updateSitemap
is good enough.