Debugging Angular with Visual Studio Code hosted on App Engine.
This covers debugging Angular as the client with Express as the web server, which will be hosted on App Engine.
Setting | Value |
---|---|
Purpose | Debugging with VS Code using a simple Angular project |
Client | Angular application |
Server | Express web server |
Client Framework | Angular |
Client Language | TypeScript |
Server Language | JavaScript |
Architecture | npm/node |
IDE | Visual Studio Code |
License | GPL v3 |
Tutorial | Youtube Tutorial |
The app generation is based on https://angular.io/guide/setup-local.
- Run
npm install -g @angular/cli
- Install the app generator CLI tool. - Run
ng new client
- Generate an application, I named itclient
. - Run
cd client
- Change directory to the app. - Run
ng serve --open
- Start the compiler, web server and open Chrome.
- From the project root, run
npm install
to download the libraries used in the client and server directories.
- Use the VS Code Launcher
1. Launch Server
- http://localhost:8080 - ./ server
- http://localhost:8080/api - ./api server
The client uses a proxy to the server. Proxy config reference.
- Use the VS Code Launcher
2. Launch ng serve & Chrome
- http://localhost:4200 - ./ - client
- http://localhost:4200/api - ./api - server
- From the ./server directory run
npm start
to start the express web server. - From the ./client directory run
npm start
to start the client compiler and angular debugging.
The application is deployed to https://donnelson-sandbox.appspot.com.
- .travis.yml deploys the application to GAE on master commits.
- Run
cd ./dist
- Run
gcloud app deploy
These are the instructions I used to generate angular and configure App Engine on GCP.
The app generation is based on https://angular.io/guide/setup-local.
- Run
npm install -g @angular/cli
- Install the app generator CLI tool. - Run
ng new client
- Generate an application, I named itclient
. - Run
cd client
- Change directory to the app. - Run
ng serve --open
- Start the compiler, web server and open Chrome.
- Sign up for Google Cloud Compute.
- Create a GCP project.
- Create an App Engine Application https://console.cloud.google.com/appengine/start.
- This app is Node.js & a Standard App Engine deployment.
- Download Cloud SDK CLI tools
- Run gcloud init
- Create a service account for App Engine Admin for deployments.
- And be sure you add the
Cloud Build API
permissions to the services account. - And turn on the Cloud API Dash for the project.
- And be sure you add the
- Create an App Engine project in the console https://console.cloud.google.com/appengine.
- After you create an app engine project, follow the App Engine getting strted instructions on how to install Cloud CLI.
app.yaml configures the App Engine web hosting service options. app.yaml reference