Ganjoor.net REST API done in swift
Database is needed for local development.
You need latest version of Xcode and Install mysql using Homebrew
$ brew install mysql
make sure you are in project directory and start a build
$ swift build
Run
$ ./.build/debug/GanjoorAPI
If you like to build/edit project in xcode you can generate xcode project by using this command
$ swift package generate-xcodeproj
Install swift 3.1 by following getstarted and after install these packages
$ apt -y install clang libicu-dev libcurl4-openssl-dev libssl-dev libmysqlclient-dev
make sure you are in project directory and start a build
$ swift build
Run
$ ./.build/debug/GanjoorAPI
If you just want to run a docker container locally to host the API and the Database for you:
$ docker-compose pull
$ docker-compose up
This might take a while, wait until you see "GanjoorAPI is connected to database" Which means everything went as expected.
When server starts you will be provided with an access key which is something like this:
new token with accessLevel developer: TOKENHERE
You should send that token on every request as header parameter like:
Authorization: Barear TOKENHERE
can see the list of acceptable requests here
This software is released under the MIT License.