A proper RESTful API written in Swift using the Perfect framework
- Install Swift 3.1 dependencies
sudo apt-get install clang libicu-dev
- Get the latest Swift 3.1 snapshot
wget https://swift.org/builds/swift-3.1-release/ubuntu1604/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu16.04.tar.gz
- Import swift GPG keys
wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- Unzip the Swift bundle you downloaded above and add the contained
/usr/bin
folder do your PATH
tar xzf swift-3.1-RELEASE-ubuntu16.04.tar.gz
export PATH=/absolute/path/to/swift-3.1-RELEASE-ubuntu16.04/usr/bin:"${PATH}"
- Install NewHomzAPI dependencies
sudo apt-get install libpython2.7 libcurl3 libmysqlclient-dev libssl-dev uuid-dev
- Clone the repo and build
git clone https://github.com/ciauri/HomzAPIv2.git
cd HomzAPIv2
swift build
- The binary will be built and reside in the .build/debug folder and be named
NewHomzAPI
To install MySQL:
brew install mysql
Unfortunately, at this point in time you will need to edit the mysqlclient.pc file located here:
/usr/local/lib/pkgconfig/mysqlclient.pc
Remove the occurrance of "-fno-omit-frame-pointer". This file is read-only by default so you will need to change that first.
swift build
If you would like to develop in Xcode:
swift package generate-xcodeproj
- Modify the
config_sample.plist
to your specifications. - Use the command line argument
-config
to point to the desired config plist. ./NewHomzAPI -config /path/to/your/plist
- That's it!
- If you're using Xcode for development, make sure you Edit Scheme -> Arguments -> add the
-config /path/to/config.plist
as a command line argument
You can hit up the sample environment if you want to see this puppy in action with a live database