GitXplorerGitXplorer
v

heroku-vapor-template

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
c12cb0d2479015b940961ed5a6d1292131618d82

Pin Swift 5.0.1

vvzsg committed 5 years ago
Verified
14fadf4301a7bc36f15620ddc900bdf5fb2c9e94

Use realistic default Postgres URL

vvzsg committed 5 years ago
Verified
e46064d467d472b3b612b648ff61e4472a8d17db

Delete Package.resolved

vvzsg committed 5 years ago
Verified
134e07f8d2ba4f0653fb02b5d0eff247fc0ac1c7

Update README.md

vvzsg committed 5 years ago
Unverified
f1d875159ea71086ccba6da95bed35bfce081617

Pin Swift 5.0

vvzsg committed 5 years ago
Unverified
58114e1b07554c670328992e2702c085278a991b

Add Heroku-customized API template

vvzsg committed 5 years ago

README

The README file for this repository.

Heroku API Template

Documentation Team Chat MIT License Swift 4.2

Using the template

  1. Clone the template

    # You can use either the Vapor Toolbox, or just git clone directly.
    
    $ vapor new YourApp --template=vzsg/heroku-vapor-template
    
    # Or:
    
    $ git clone https://github.com/vzsg/heroku-vapor-template YourApp
    $ cd YourApp
    $ rm -rf .git           # detach folder from template repo
    $ git init              # start new Git repo
    # Optional:  edit Package.swift - change "VaporApp" to whatever you like
  2. Create a Heroku application

    # Append --region=eu if you want to use the EU region
    $ heroku apps:create your-heroku-app-name
  3. Set up buildpack

    $ heroku buildpacks:set vapor/vapor
  4. Add a free database

    $ heroku addons:create heroku-postgresql:hobby-dev
  5. Commit and push

    $ git add .
    $ git commit -m "Initial commit"
    $ git push heroku master
    
  6. Test if it's working

    $ heroku open

Changes from the original api-template

  • PostgreSQL is used instead of SQLite, which is configured with the DATABASE_URL environment variable if provided. The configuration is compatible with both the free and paid plans of Heroku Postgres.
  • The provided Procfile ensures that all required command line parameters are passed to the app.
  • The HSTSMiddleware automatically redirects HTTP calls to their HTTPS equivalents.