Hey there!
This repo is a vapor 3 (a swift web framework) app template with auth routes, and it's ready to be deployed to Heroku.
The main purpose of this is to serve me as a starting point for my apps and to inspire you to hack your own!
Or please feel free to just use this as a starting template for your apps!
You may also freely use any code from this repo without attribution.
If you want to reach out, please feel free to drop me a line here:
let account = ["true", "metal", "of", "steel"].joined(separator: ".")
let host = ["gmail", "com"].joined(separator: ".")
let res = [account, host].joined(separator: "@")Cheers,
Dan
http://ios-engineer.com
Heroku/postgresreadyHTTPSonly,HTTPrequests are rejected with 403 forbidden- Pre-populated with 4 user accounts -
u1,u2,u3andu4 -
- passwod is
123- same for all of them
- passwod is
-
- comes with pre-populated access tokens -
u1 token,u2 token,u3 tokenandu4 token
- comes with pre-populated access tokens -
GET/,/hello,/hello/name-
- hello routes for quick tests
wss://host/ws-
- a websocket connection, will reverse and return whatever you send it
POST/register-
- send
usernameandpasswordas form-data
- send
POST/login-
- send credentials as HTTP basic auth
POST/logout-
- auth protected, removes token
GET/me-
- will return current username
GET/users-
- will return list of all users (except for the one making the request)
There's an option to use vapor toolbelt, but I prefer to do this manually:
- create
herokuapp and addpostgresdatabase to it git clone https://github.com/truemetal/vapor-heroku-auth-template.gitto your macgit remote add heroku <your heroku app git url>heroku buildpacks:set https://github.com/vapor-community/heroku-buildpack.gitgit push heroku master
git remote rm origingit remote add origin <your repo path>
- Make sure to define
DATABASE_URL -
- e.g. something this could go to your
~/.zshrcor~/.bash_profile:export DATABASE_URL="postgresql://user@localhost:5432/database"
- e.g. something this could go to your
- Use
vapor xcode -yorswift package generate-xcodeprojto create.xcodeprojand./suppress-xcodeproj-warnings.rbto hide warnings from vapor frameworks
Contributions are welcome! Please just open an issue or send a pull request.
