Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu committed Sep 24, 2024
1 parent 18fa723 commit 3ad76bd
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,27 @@ This project is a Minimal APIs application built with ASP.NET Core and Playwrigh
dotnet restore
```

### Environment Variables
## Configuration

Set the `API_KEY` environment variable to secure your API:
Set the `ApiKey` in your `appsettings.json` file to secure your API:

- **On Windows**:

```powershell
$Env:API_KEY = "your-api-key-here"
```

- **On Linux/macOS**:

```bash
export API_KEY="your-api-key-here"
```
```json
{
"ApiKey": "your-api-key-here",
// ... other settings
}
```

Alternatively, you can set the environment variable in the `launchSettings.json` file for development purposes:
Alternatively, you can set the `ApiKey` in the `appsettings.Development.json` file for development purposes:

```json
{
"profiles": {
"PdfGeneratorApi": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"API_KEY": "your-api-key-here"
}
}
}
"ApiKey": "your-api-key-here"
}
```

**Note**: Do not commit sensitive information like API keys to version control.
**Note**: Do not commit sensitive information like API keys to version control repositories. For production environments, consider using environment variables or a secure secrets management solution to store sensitive data.


## Running the Application

Expand Down

0 comments on commit 3ad76bd

Please sign in to comment.