Both projects are run as a Static Web App:
- BestMovies.WebApp - the static content
- BestMovies.Bff - the azure functions
Note: Install swa
using npm install -g @azure/static-web-apps-cli
swa start http://localhost:5124 --run "dotnet watch run --project ./BestMovies.WebApp/BestMovies.WebApp.csproj" --api-devserver-url http://localhost:7071
Note: Make sure you use Node v20.0.0+ and you have local.settings.json
file
- Add
BestMoviesApi.BaseUrl
to yourlocal.settings.json
file \ - Add
TMDB_API_KEY
to yourlocal.settings.json
file \ - Add
MASTER_KEY
to yourlocal.settings.json
file, which is used in the headerx-functions-key
- Add header
x-ms-client-principal
that contains theClientPrincipal
as base64
Note ClientPrincipal
looks like:
{
"identityProvider": "google",
"userId": "<userId>",
"userDetails": "<email>@gmail",
"userRoles": ["anonymous", "authenticated"]
}
The project is an azure function
- Create a database in your local Sql Server
- Get the connection string to it.
- Create a new
local.settings.json
file similar to one in the BestMovies.Bff project. - Add the
DbConnectionString
to yourlocal.settings.json
file