Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nokka/d2-armory-api
Diablo II armory API server.
https://github.com/nokka/d2-armory-api
d2-armory diablo-ii
Last synced: about 2 months ago
JSON representation
Diablo II armory API server.
- Host: GitHub
- URL: https://github.com/nokka/d2-armory-api
- Owner: nokka
- Created: 2017-01-31T20:09:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T12:11:35.000Z (about 1 year ago)
- Last Synced: 2024-06-19T10:13:51.873Z (7 months ago)
- Topics: d2-armory, diablo-ii
- Language: Go
- Homepage:
- Size: 130 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# d2 armory api
The armory backend is responsible for storing and parsing d2s characters.
It also exposes an HTTP API to get characters as JSON.---
## Environment variables
| Name | Default |
|--------------------- |----------------- |
| HTTP_ADDRESS | `:80` |
| MONGO_HOST | `mongodb:27017` |
| MONGO_DB | `armory` |
| MONGO_USERNAME | |
| MONGO_PASSWORD | |
| D2S_PATH | |
| CACHE_DURATION | `3m` |
| STATISTICS_USER | |
| STATISTICS_PASSWORD | |
| CORS_ENABLED | `false` |
| LOG_REQUESTS | `false` |---
## API
#### Get a character by name
Gets the character by name, either served through the mongoDB
cache or by parsing the d2s binary if the cache duration has expired.
```http
GET /api/v1/characters?name=nokka
```#### Deprecated handler for consumers who rely on it
Deprecated handler used by < v1.0.0 users.
```http
GET /retrieving/v1/character?name=nokka
```#### Health check
```http
GET /health
```---
## Package dependency graph
![Package dependency graph](docs/deps.png)### How to generate the graph
[godephgraph](https://github.com/kisielk/godepgraph) is used to generate the dependency graph.```bash
$ godepgraph -nostdlib -novendor -horizontal -onlyprefixes=github.com/nokka/d2-armory-api github.com/nokka/d2-armory-api/cmd/server | dot -Tpng -o docs/godepgraph.png
```
---## Data storage
The armory API relies on [mongodb](https://www.mongodb.com/) to store the data.