The GFL API written in Elixir. I'm writing this project to practice Elixir, a functional programming language I'm learning.
-
Install a MySQL server.
-
Modify your environment config in
config/<env>.exs
and configure the MySQL details along with the authorization token (token
variable). -
Install dependencies by running
mix deps.get
. -
Create database by running
mix ecto.create
. -
Migrate necessary schemas by running
mix ecto.migrate
. -
Run the web server by running
mix phx.server
.
Note - By default, the web server binds to port 4000
. Therefore, if you're using localhost, you can grab the player's perk status by going to http://localhost:4000/donators?steamid=<steamid>
. Otherwise, you can use NGINX and write a proxy config to redirect to the web application.
The web application returns a JSON array such as the following:
{"error":-1,"group":1,"steamid":"12345"}
Note - When the Steam ID isn't found, group
will return 0
and error
will be set to 404
.