Skip to content

loiane/mslearn-functions-angular

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Refactor Node.js Express to Azure Functions

TypeScript Node/Express 👉TypeScript Serverless Angular

This project was created to help represent a fundamental app written with Node Express APIs and TypeScript that can be shifted to Serverless Functions with TypeScript.

The client app is Angular, however it could just as easily be Vue or React. The vacations theme is used throughout the app.

by John Papa

Why

I love Node and Express for creating APIs! These require a server and paying for that server in the cloud. Shifting to serverless alleviates the cost, the server upkeep, helps scale up and down easily, and reduces the surface area of the middleware required for a robust Express app. Is it perfect? No, of course not! But this is a solid option if these factors affect you.

Prerequisites

Make a copy of the env.example file named .env, in the root of the project. It should contain the following code.

.env

NODE_ENV=development
PORT=7070
WWW=./

Getting Started

  1. Clone this repository

    git clone https://github.com/MicrosoftDocs/mslearn-module-shifting-nodejs-express-apis-to-serverless learn-functions
    cd learn-functions
  2. Install the npm packages

    npm install
  3. Build the Node Express and the Angular code

    npm run full:build
  4. Run the app

    npm run node:start

Debug Node Express and Angular

  1. Stop any debugging sessions that may be currently running

  2. Open proxy.conf.json and set the port to 7070

  3. Open the VS Code Command Palette F1

  4. Type View: Show Debug and press ENTER

  5. Select Debug Express and Angular

  6. Press F5

  7. Open the browser to http://localhost:4200

You may now set break points in the Express and Angular code.

Debug Functions and Angular

  1. Stop any debugging sessions that may be currently running

  2. Open proxy.conf.json and change the port to 7071

  3. Open the VS Code Command Palette F1

  4. Type View: Show Debug and press ENTER

  5. Select Debug Functions and Angular

  6. Press F5

  7. Open the browser to http://localhost:4200

You may now set break points in the Functions and Angular code.

Problems or Suggestions

Open an issue here

Resources

Debugging Resources

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •