Backend for WBooks iOS Training, made entirely in Swift.
- Swift 4.x
- Apiary: Here you will find all the information necessary to interact with the API.
The app is now running on Heroku. You can interact with it through this URL:
https://swift-training-backend.herokuapp.com/
curl https://swift-training-backend.herokuapp.com/books
Run the following script to set up the project:
sh Scripts/complete_installation
Once finished, you can now run the project with:
vapor run
If you want to fill the database with made-up data, keep the app running and exectute this on another terminal:
sh Scripts/insert_data
All done! You're ready to start using the API :)
- Install Heroku CLI:
brew install heroku/brew/heroku
- Log in to Heroku:
heroku login
- Ask your Team Leader to be added as a Collaborator. This will give you the proper permissions to push to the Heroku repository.
- After you have been added as a Collaborator, add the remote repository:
heroku git:remote -a swift-training-backend
- Well done! You are ready to deploy. In order to do so, run the following command:
vapor heroku push
It might take a while, but in the meantime you can check out the build logs from the Dashboard.
You can see the remote logs with the following command:
heroku logs --tail
If Xcode doesn't show the correct files, or the project structure seems wrong, just run the following command:
vapor update -y
This will update dependencies and create the appropiate Xcode project files. Xcode will restart after the command executes.