Configuring environment

Configure environment

Use multiple environments in ASP.NET Core

Development environment

export ASPNETCORE_ENVIRONMENT=Development

Production environment.

export ASPNETCORE_ENVIRONMENT=Production

Open Properties/launchSettings.json and change the ASPNETCORE_ENVIRONMENT

// ...
"DatingApp.API": {
  "commandName": "Project",
  "launchBrowser": true,
  "launchUrl": "api/values",
  "applicationUrl": "https://localhost:5001;http://localhost:5000",
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Production"the application (insert your api keys and token secret in the
  }
}
// ...

Run the application (insert your api keys and token secret in the variables)

# Optional
export ASPNETCORE_ENVIRONMENT=Production

export AppSettings__TokenSecret=""
export CloudinarySettings__CloudName=""
export CloudinarySettings__ApiKey=""
export CloudinarySettings__ApiSecret=""
dotnet run