meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ixc2024:tech:tools:backendoftheapplication [2024/05/27 17:03] hibaaixc2024:tech:tools:backendoftheapplication [2024/05/27 18:55] (current) hibaa
Line 254: Line 254:
 ==Deploying API Service to Google Cloud == ==Deploying API Service to Google Cloud ==
  
-**Create app.yaml**+-> **Create app.yaml**
  
 To deploy the app we need to create a configuration file in our project's root directory. This file has to be a yaml file as per Google’s recommendation. For the purpose of this tutorial we will create a file called app.yaml in our root directory and add the settings and routing for Google App Engine. To deploy the app we need to create a configuration file in our project's root directory. This file has to be a yaml file as per Google’s recommendation. For the purpose of this tutorial we will create a file called app.yaml in our root directory and add the settings and routing for Google App Engine.
Line 262: Line 262:
    # [START app_yaml]    # [START app_yaml]
    runtime: nodejs20    runtime: nodejs20
-   service: node-express-api+   entrypoint: node index.js
    # [END app_yaml]    # [END app_yaml]
  
-**Explanation of the Configuration:** +__Notes:__
   * runtime: Specifies the runtime environment (e.g., nodejs20)   * runtime: Specifies the runtime environment (e.g., nodejs20)
   * service: Defines the service name, typically a project-specific prefix or subdomain.   * service: Defines the service name, typically a project-specific prefix or subdomain.
 +  * entrypoint: By default App Engine expects server.js as the entry point but if your app uses anything else then you specify that here.
  
-**Deploy your App Locally**+-> **Deploy your App Locally**
  
-Deploy your Node app by executing the command in root directory of your project+  - Close your command prompt and open it again 
 +  - Run **'gcloud** to make sure that everything is connected 
 +  - Navigate to your project folder **'cd waste-backend'** 
 +  - Run the command **'gcloud init'** 
 +  - Select **'1'** to re-initialize the configuration [default] with new settings 
 +  - Select the email account that you are using in your Cloud Console to perform operations for this configuration 
 +  - Pick the number allocated to your project 
 +  - Deploy your Node app by executing the command in root directory of your project
  
    gcloud app deploy    gcloud app deploy
 +   
 +5. Choose a region where you want your App Engine Application to be located
  
 ====Additional Resources==== ====Additional Resources====