Start the web-app and web-api and then visit localhost:3000
. Adapted from
the
active-directory-node-webapi
exmaple app and this
course.
Note that the environment varialbes are set with powershell syntax below. Adjust for your terminal accordingly
Set environment variables:
$env:tenantName = "myAzureTenantName"
$env:tenantID = "12341234-1234-1234-12341234123412341"
$env:clientID = "1324asdf-1234-asdf-1234asdfasdfasdfa"
$env:clientSecret = "thesecretyoucreatedforyourapp123"
$env:appURI = "https://myAPIregistrationURI"
Then run the app:
cd web-app
npm install
npm start
Set environment variables as above then build and run the docker container:
Note that the only reason to do this is to test out the docker build, since the api running in a lonely docker container has no way to call out to the API that might be running in another the docker container or from the command line
cd web-app
docker build . -t web-app
docker run --rm -it -e tenantName -e tenantID -e clientID -e clientSecret -e appURI -p 3000:3000 web-app
Set environment variables taken from the overview blade of the web-api registration:
$env:tenantName = "myAzureTenantName"
$env:tenantID = "12341234-1234-1234-12341234123412341"
$env:clientID = "abcdabcd-abcd-abcd-abcdabcdabcdabcda"
$env:audience = "https://myAPIregistrationURI"
Then run the app:
cd api-server
npm install
npm start
Set environment variables as above then build and run the docker container:
cd api-server
docker build . -t web-api
docker run --rm -it -e tenantID -e clientID -e audience -p 5000:5000 web-api
Update the environment varialbe definitions in the docker-compse.yml
file with the values above, and run:
docker-compose build
docker-compose up