-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vapor/spring-cleaning
Spring cleaning
- Loading branch information
Showing
36 changed files
with
528 additions
and
824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
Sources/Routing/Router+Routes.swift → Sources/Branches/Branch+Paths.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import HTTP | ||
|
||
extension Method { | ||
public static var wildcard: Method { | ||
return .other(method: "*") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Branches | ||
import HTTP | ||
import Node | ||
|
||
private let parametersKey = "parameters" | ||
|
||
extension HTTP.Request { | ||
/// when routing a url with slug parameters, ie: | ||
/// foo/:id | ||
/// the request will populate these values before passing to handeler | ||
/// for example: | ||
/// given route: /foo/:id | ||
/// and request with path `/foo/123` | ||
/// parameters will be `["id": 123]` | ||
public var parameters: Node { | ||
get { | ||
if let existing = storage[parametersKey] as? Node { | ||
return existing | ||
} | ||
|
||
let node = Node([:]) | ||
storage[parametersKey] = node | ||
return node | ||
} | ||
set { | ||
storage[parametersKey] = newValue | ||
} | ||
} | ||
} |
Oops, something went wrong.