Identity

Create an instance of the terminal and navigate to the /azure-quickstart/identity directory

initialize a new project and add dependencies

/azure-quickstart/identity (terminal commands)
# Init NPM
npm init -y

# Install Dependencies
npm i typescript ts-node --save-dev
npm i @types/node --save
npm i express express-validator grpc dapr-client
npx tsc --init

# Create src directory
mkdir src

edit package.json and add build, start, and start:dev as noted below (test should already exist)

/azure-quickstart/identity/package.json


...

  "scripts": {
    "build": "rimraf ./dist && tsc",
    "start": "npm run build && node dist/index.js",
    "start:dev": "npm run build && nodemon --ext \".ts,.js\" --watch \"./src\" --exec \"ts-node ./src/index.ts\"",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

...

edit tsconfig.json to compile output to the dist/ directory by uncommenting and configuring values for outDir and rootDir

/azure-quickstart/identity/tsconfig.json
...

    "outDir": "./dist",                       /* Redirect output structure to the directory. */
    "rootDir": "./src",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
...
  
...

Add additional NPM modules to set up basic services: npm i express express-validator

Create a build config..

In VS Code

Last updated