GwentAPI
The code for GwentAPI
GwentAPI is a RESTful API dedicated to provide information regarding GWENT®: The Witcher Card Game. You may use its interface to consume information on cards, factions, etc.
How to use
GwentAPI is release for both Linux and Windows. You can find the download here.
The data allowing you to seed the database is included in the releases. Read the file DATABASE_INSTRUCTIONS.md to know how to feed the database.
Change the values found in config.toml to suit your environment. The configuration file must be kept in the same directory as the executable.
Install from source
Requirement & dependencies
- Bash (use MINGW/git bash or cygwin for windows)
- Go 1.8
- MongoDB 3.4
- Python 3.4.2
- Git
- jq-1.5
Installation
Assuming you installed and configure all the required softwares listed above and that you have a working Go setup:
Build the software
go get github.com/GwentAPI/gwentapi
- GwentAPI uses the expimental dep tool to manage the Go dependencies, however they are included in the
vendor directory to help build the software on CI platforms.
- Change your monboDB credentials in the
init() of the /dataLayer/dal/db.go file if needed. By default it connects to localhost on no particular users (no SSL, access control not enabled).
- Compile:
- Optionally set the version of the binary (displayed with the -v flag) by changing the value of
version in main.go before compiling or set it at compile time with the following command:
go build -ldflags="-X main.version=<versionString>"
- Optionally modify the
baseURL in the config.toml file to change where resources are pointing to.
The program will run on localhost on port 8080 by default.
How to contribute?
Read the CONTRIBUTING.md file.
Where are the artworks and why does latest.jsonl refers to gwentify?
latest.jsonl is generated by Arachas a web crawler that extract data from gwentify.com.
GwentAPI doesn't hot link to gwentify and so, the database population script will replace the url. The artworks isn't included because git doesn't like binary files and neither do I like including binary files in git.