chore: update README.md
This commit is contained in:
parent
e9c719c019
commit
85eec8939f
62
README.md
62
README.md
|
@ -1,10 +1,10 @@
|
||||||
# TWHelp API
|
# tribalwarshelp.com API
|
||||||
|
|
||||||
A GraphQL API for Tribal Wars data.
|
A GraphQL API designed for developers who want to create something meaningful for the game [Tribal Wars](https://tribalwars.net).
|
||||||
|
|
||||||
## Limits
|
## Limits
|
||||||
|
|
||||||
You can fetch in one GraphQL query:
|
It is possible to fetch in one GraphQL query:
|
||||||
|
|
||||||
1. 1000 daily player/tribe stats records
|
1. 1000 daily player/tribe stats records
|
||||||
2. 200 ennoblements
|
2. 200 ennoblements
|
||||||
|
@ -18,9 +18,7 @@ You can fetch in one GraphQL query:
|
||||||
|
|
||||||
## Sample queries
|
## Sample queries
|
||||||
|
|
||||||
You can check how to make requests from JavaScript [here](https://github.com/tribalwarshelp/scripts).
|
1. Fetch all bonus villages with 10% more population
|
||||||
|
|
||||||
1. All bonus villages with 10% more population
|
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
query {
|
query {
|
||||||
|
@ -77,12 +75,14 @@ query {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
More examples [here](https://github.com/tribalwarshelp/scripts).
|
||||||
|
|
||||||
## Map service
|
## Map service
|
||||||
|
|
||||||
You can generate a server map with this API. The current endpoint is http(s)://youraddress/map/server (replace "server" with the server you're interested in, for example, pl151).
|
You can generate a server map with this API. The current endpoint is http(s)://youraddress/map/server (replace "server"
|
||||||
|
with the server you're interested in, for example, pl151).
|
||||||
|
|
||||||
### Available query params:
|
### Available query params:
|
||||||
|
|
||||||
|
@ -99,16 +99,27 @@ You can generate a server map with this API. The current endpoint is http(s)://y
|
||||||
| backgroundColor | #000 |
|
| backgroundColor | #000 |
|
||||||
| gridLineColor | #fff |
|
| gridLineColor | #fff |
|
||||||
| continentNumberColor | #fff |
|
| continentNumberColor | #fff |
|
||||||
| tribe(this param you can define multiple times) | format tribeid,hexcolor (for example, tribe=631,#0000ff) |
|
| tribe(this param you can define multiple times) | format: tribeid,hexcolor (for example, tribe=631,#0000ff) |
|
||||||
| player(this param you can define multiple times) | format playerid,hexcolor (for example, player=631,#0000ff) |
|
| player(this param you can define multiple times) | format: playerid,hexcolor (for example, player=631,#0000ff) |
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
**pl151**
|
**pl151**
|
||||||
|
```
|
||||||
|
https://api.tribalwarshelp.com/map/pl151?showBarbarian=true&tribe=124,%230000ff&tribe=631,%230000ff&tribe=1675,%230000ff&onlyMarkers=false&scale=1&showGrid=true&showContinentNumbers=true
|
||||||
|
```
|
||||||
![Map](https://api.tribalwarshelp.com/map/pl151?showBarbarian=true&tribe=124,%230000ff&tribe=631,%230000ff&tribe=1675,%230000ff&onlyMarkers=false&scale=1&showGrid=true&showContinentNumbers=true)
|
![Map](https://api.tribalwarshelp.com/map/pl151?showBarbarian=true&tribe=124,%230000ff&tribe=631,%230000ff&tribe=1675,%230000ff&onlyMarkers=false&scale=1&showGrid=true&showContinentNumbers=true)
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
1. Golang
|
||||||
|
2. PostgreSQL database
|
||||||
|
3. Configured [cron](https://github.com/tribalwarshelp/cron)
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
**Required ENV variables:**
|
**Required ENV variables:**
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -118,18 +129,27 @@ DB_PORT=your_pgdb_port
|
||||||
DB_HOST=your_pgdb_host
|
DB_HOST=your_pgdb_host
|
||||||
DB_PASSWORD=your_pgdb_password
|
DB_PASSWORD=your_pgdb_password
|
||||||
LIMIT_WHITELIST=127.0.0.1,::1
|
LIMIT_WHITELIST=127.0.0.1,::1
|
||||||
LOG_DB_QUERIES=[true|false]
|
LOG_DB_QUERIES=true
|
||||||
```
|
```
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
1. Golang
|
|
||||||
2. PostgreSQL database
|
|
||||||
3. Configured [cron](https://github.com/tribalwarshelp/cron)
|
|
||||||
|
|
||||||
### Installing
|
|
||||||
|
|
||||||
1. Clone this repo.
|
1. Clone this repo.
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone git@github.com:tribalwarshelp/api.git
|
||||||
|
```
|
||||||
|
|
||||||
2. Navigate to the directory where you have cloned this repo.
|
2. Navigate to the directory where you have cloned this repo.
|
||||||
3. Set the required env variables directly in your system or create .env.development file.
|
3. Set the required env variables directly in your system or create .env.local file.
|
||||||
4. go run main.go
|
4. Run the app.
|
||||||
|
|
||||||
|
```
|
||||||
|
go run main.go
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Distributed under the MIT License. See ``LICENSE`` for more information.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
Dawid Wysokiński - [contact@dwysokinski.me](mailto:contact@dwysokinski.me)
|
||||||
|
|
Reference in New Issue
Block a user