Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/_docs/admin-guide/tavern.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,24 @@ query PeristenceTomes {
}
}
```

## CDN HTTP API

### Upload - POST /cdn/upload - AUTHENTICATED

The upload API for the Tavern CDN use forms and the POST method. The parameters are `fileName` and `fileContent`. and the API will return an Ent ID for the file created. A curl example is shown below:

```bash
[$ /tmp] curl --cookie "auth-session=REDACTED" -F "fileName=test_file" -F "fileContent=@/path/to/file" https://example.com/cdn/upload
{"data":{"file":{"id":4294967755}}}%
```

### Playground - GET /cdn/{fileName} - UNAUTHENTICATED

The download API is a simple GET request where the `fileName` provided as part of the upload request(or any `File` Ent) is appended to the path. Additionally the endpoint is unauthenticated so no cookie is required (and easy to use from Imix!). An example of accessing the API via eldritch is below:

```python
f = http.get(f"https://example.com/cdn/{fileName}", allow_insecure=True)
```

As these files are stored in the `File` Ent, they can also be accessed via the `asset` eldritch library functions.
Loading