forked from TechEmpower/FrameworkBenchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41de3e2
commit 473cc79
Showing
9 changed files
with
90 additions
and
5 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
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
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
import Vapor | ||
|
||
extension World: Content {} | ||
extension Fortune: Content {} |
18 changes: 18 additions & 0 deletions
18
frameworks/Swift/vapor/vapor-swifql-ikiga/Sources/Extensions/Utils.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extension Int { | ||
func bounded(to range: ClosedRange<Int>) -> Int { | ||
switch self { | ||
case ...range.lowerBound: | ||
return range.lowerBound | ||
case range.upperBound...: | ||
return range.upperBound | ||
default: | ||
return self | ||
} | ||
} | ||
} | ||
|
||
extension Int: Sequence { | ||
public func makeIterator() -> CountableRange<Int>.Iterator { | ||
return (0..<self).makeIterator() | ||
} | ||
} |
7 changes: 6 additions & 1 deletion
7
frameworks/Swift/vapor/vapor-swifql-ikiga/Sources/Models/Fortune.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import Bridges | ||
import SwifQL | ||
|
||
final class Fortune: Table { | ||
final class Fortune: Table, Schemable { | ||
@Column("id") | ||
var id: Int32? | ||
|
||
@Column("message") | ||
var message: String | ||
|
||
init() {} | ||
init(id: Int32, message: String) { | ||
self.id = id | ||
self.message = message | ||
} | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
frameworks/Swift/vapor/vapor-swifql-ikiga/Sources/Resources/Views/fortune.leaf
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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head><title>Fortunes</title></head> | ||
<body> | ||
<table> | ||
<tr><th>id</th><th>message</th></tr> | ||
#for(planet in planets):<tr><td>#(fortune.id)</td><td>#(fortune.message)</td></tr> | ||
#endfor</table> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import Vapor | ||
import PostgresBridge | ||
import IkigaJSON | ||
import Logging | ||
|
||
@main | ||
|