An Express JS server to handle Android image & Firestore requests
Before running the backend service locally, ensure you have the necessary tools and configurations in place.
Make sure you have the gcloud CLI installed on your machine. Follow the Download & Install gcloud CLI.
Authenticate your local machine with Google Application Default Credentials (ADC) and configure it with your Google Cloud Platform (GCP) account. Refer to the ADC documentation.
To run the backend service, follow these steps:
-
Open a terminal in the
backend-service-1-nodedirectory. -
Install the required dependencies using npm:
npm install
-
Start the Express JS server in development mode:
npm run devStart
-
Add start script in the
package.json"start": "node server.js"
-
Open file
server.jsand change the port to:const port = process.env.PORT || 3000;
-
Create new file
app.yamlruntime: nodejs16 service: [your service name]
-
Open Google Cloud CLI & deploy the service with:
gcloud app deploy