Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
copy vapor servers.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Jul 13, 2016
1 parent 41414cc commit 9c19a5e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
10 changes: 5 additions & 5 deletions App/Controllers/UserController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ final class UserController: Resource {
drop = droplet
}

func index(_ request: Request) throws -> ResponseRepresentable {
func index(request: Request) throws -> ResponseRepresentable {
return JSON([
"controller": "UserController.index"
])
}

func store(_ request: Request) throws -> ResponseRepresentable {
func store(request: Request) throws -> ResponseRepresentable {
return JSON([
"controller": "UserController.store"
])
Expand All @@ -24,20 +24,20 @@ final class UserController: Resource {
Since item is of type User,
only instances of user will be received
*/
func show(_ request: Request, item user: User) throws -> ResponseRepresentable {
func show(request: Request, item user: User) throws -> ResponseRepresentable {
//User can be used like JSON with JsonRepresentable
return JSON([
"controller": "UserController.show",
"user": user
])
}

func update(_ request: Request, item user: User) throws -> ResponseRepresentable {
func update(request: Request, item user: User) throws -> ResponseRepresentable {
//User is JsonRepresentable
return user.makeJSON()
}

func destroy(_ request: Request, item user: User) throws -> ResponseRepresentable {
func destroy(request: Request, item user: User) throws -> ResponseRepresentable {
//User is ResponseRepresentable by proxy of JsonRepresentable
return user
}
Expand Down
4 changes: 1 addition & 3 deletions Config/production/servers.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"production": {
"port": "$PORT",
"host": "0.0.0.0",
"securityLayer": "none"
"port": "$PORT"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ View [Vapor](https://github.com/qutheory/vapor) for documentation.

## Requirements

Swift 3.0 beta 2 is required (Xcode 8 beta 2 on macOS).
Swift 3.0 preview 2 is required (Xcode 8 beta 2 on macOS).

Works on Ubuntu, Docker, Heroku, macOS.

Expand Down
25 changes: 10 additions & 15 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
{
"name": "vapor-example",
"scripts": {
},
"env": {
},
"formation": {
},
"addons": [

],
"buildpacks": [
{
"url": "https://github.com/kylef/heroku-buildpack-swift"
}
]
"name": "vapor-example",
"scripts": {},
"env": {},
"formation": {},
"addons": [],
"buildpacks": [
{
"url": "https://github.com/kylef/heroku-buildpack-swift"
}
]
}

0 comments on commit 9c19a5e

Please sign in to comment.