This application serves as an example node.js application for consuming OAuth APIs exposed for World of Warcraft. The app leverages the Client Credentials flow to retrieve an OAuth token and then generate a PNG image for a given character.
http://localhost:3000/signature?region=us&realmName=tichondrius&characterName=tmpikaboo
In accordance with the World of Warcraft Community API Migration this application leverages only the WoW Game Data APIs.
To get started experimenting with this application, you will first need to follow the getting started guide to create a new OAuth client on develop.battle.net.
Once you have created your OAuth client on develop.battle.net, copy the .env.example
file to .env
, and fill in the values for the CLIENT_ID
and CLIENT_SECRET
variables. The values from the .env
file will be loaded by the dotenv library at startup.
This application leverages ImageMagic abstracted through the gm node module to manipulate and produce the image output files.
Depending on which platform you are developing on, you may be required to install ImageMagic on your system before you can successfully run and invoke the application.
To simplify the ImageMagick dependency described above, this application is also set up to run in a docker container with an existing docker-compose file already written for convenience.
You can run the application easily by invoking the docker-compose -f docker-compose.yml up
command in a command-line shell, granted that you already have Docker installed on your system.
Should you wish to experiment with this code and make changes, the application is setup to work with nodemon to watch the filesystem and restart anytime a .js
file is changed. This functionality is enabled by default when running with the above docker-compose command.
Additionally, this application is compatible with deploying on a free Heroku Account.