Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

ganjoor/GanjoorAPI-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ganjoor API - Swift

Ganjoor.net REST API done in swift

Local Development

Database is needed for local development.

MacOS

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

Generate Xcode project

If you like to build/edit project in xcode you can generate xcode project by using this command

$ swift package generate-xcodeproj

Ubuntu 16.04 LTS

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

Development Docker

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.

Making requests

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.

Releases

No releases published

Packages

No packages published

Languages