-
Notifications
You must be signed in to change notification settings - Fork 670
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 #22 from kiliankoe/master
Add Swift frameworks
- Loading branch information
Showing
16 changed files
with
363 additions
and
0 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
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,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
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,54 @@ | ||
{ | ||
"autoPin": true, | ||
"pins": [ | ||
{ | ||
"package": "CCurl", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/CCurl.git", | ||
"version": "0.2.3" | ||
}, | ||
{ | ||
"package": "Kitura", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/Kitura.git", | ||
"version": "1.7.3" | ||
}, | ||
{ | ||
"package": "Kitura-TemplateEngine", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/Kitura-TemplateEngine.git", | ||
"version": "1.7.0" | ||
}, | ||
{ | ||
"package": "Kitura-net", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/Kitura-net.git", | ||
"version": "1.7.4" | ||
}, | ||
{ | ||
"package": "LoggerAPI", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/LoggerAPI.git", | ||
"version": "1.7.0" | ||
}, | ||
{ | ||
"package": "SSLService", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/BlueSSLService.git", | ||
"version": "0.12.32" | ||
}, | ||
{ | ||
"package": "Socket", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/BlueSocket.git", | ||
"version": "0.12.46" | ||
}, | ||
{ | ||
"package": "SwiftyJSON", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/IBM-Swift/SwiftyJSON.git", | ||
"version": "16.0.0" | ||
} | ||
], | ||
"version": 1 | ||
} |
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 @@ | ||
// swift-tools-version:3.1 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "server_swift_kitura", | ||
dependencies: [ | ||
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1, minor: 7) | ||
] | ||
) |
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,19 @@ | ||
import Kitura | ||
|
||
let router = Router() | ||
|
||
router.get("/") { _, res, _ in | ||
try res.send("").end() | ||
} | ||
|
||
router.get("/user/:id") { req, res, _ in | ||
let id = req.parameters["id"] ?? "" | ||
try res.send(id).end() | ||
} | ||
|
||
router.post("/user") { _, res, _ in | ||
try res.send("").end() | ||
} | ||
|
||
Kitura.addHTTPServer(onPort: 3000, with: router) | ||
Kitura.run() |
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,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
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,42 @@ | ||
{ | ||
"autoPin": true, | ||
"pins": [ | ||
{ | ||
"package": "COpenSSL", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/Perfect-COpenSSL.git", | ||
"version": "2.0.4" | ||
}, | ||
{ | ||
"package": "PerfectHTTP", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/Perfect-HTTP.git", | ||
"version": "2.0.7" | ||
}, | ||
{ | ||
"package": "PerfectHTTPServer", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", | ||
"version": "2.0.9" | ||
}, | ||
{ | ||
"package": "PerfectLib", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/PerfectLib.git", | ||
"version": "2.0.9" | ||
}, | ||
{ | ||
"package": "PerfectNet", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/Perfect-Net.git", | ||
"version": "2.0.5" | ||
}, | ||
{ | ||
"package": "PerfectThread", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/PerfectlySoft/Perfect-Thread.git", | ||
"version": "2.0.9" | ||
} | ||
], | ||
"version": 1 | ||
} |
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 @@ | ||
// swift-tools-version:3.1 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "server_swift_perfect", | ||
dependencies: [ | ||
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2, minor: 0) | ||
] | ||
) |
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,25 @@ | ||
import PerfectHTTP | ||
import PerfectHTTPServer | ||
|
||
let server = HTTPServer() | ||
|
||
var routes = Routes() | ||
|
||
routes.add(method: .get, uri: "/", handler: { _, response in | ||
response.completed() | ||
}) | ||
|
||
routes.add(method: .get, uri: "/user/{id}", handler: { request, response in | ||
response.setBody(string: request.urlVariables["id"] ?? "") | ||
response.completed() | ||
}) | ||
|
||
routes.add(method: .post, uri: "/user", handler: { _, response in | ||
response.completed() | ||
}) | ||
|
||
server.addRoutes(routes) | ||
|
||
server.serverPort = 3000 | ||
|
||
try! server.start() |
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,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
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,108 @@ | ||
{ | ||
"autoPin": true, | ||
"pins": [ | ||
{ | ||
"package": "CLibreSSL", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/clibressl.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Console", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/console.git", | ||
"version": "1.0.2" | ||
}, | ||
{ | ||
"package": "Core", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/core.git", | ||
"version": "1.1.2" | ||
}, | ||
{ | ||
"package": "Crypto", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/crypto.git", | ||
"version": "1.1.0" | ||
}, | ||
{ | ||
"package": "Engine", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/engine.git", | ||
"version": "1.3.12" | ||
}, | ||
{ | ||
"package": "Fluent", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/fluent.git", | ||
"version": "1.4.3" | ||
}, | ||
{ | ||
"package": "JSON", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/json.git", | ||
"version": "1.0.6" | ||
}, | ||
{ | ||
"package": "Jay", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/DanToml/Jay.git", | ||
"version": "1.0.1" | ||
}, | ||
{ | ||
"package": "Leaf", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/leaf.git", | ||
"version": "1.0.7" | ||
}, | ||
{ | ||
"package": "Node", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/node.git", | ||
"version": "1.0.1" | ||
}, | ||
{ | ||
"package": "PathIndexable", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/path-indexable.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Polymorphic", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/polymorphic.git", | ||
"version": "1.0.1" | ||
}, | ||
{ | ||
"package": "Routing", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/routing.git", | ||
"version": "1.1.0" | ||
}, | ||
{ | ||
"package": "Socks", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/socks.git", | ||
"version": "1.2.7" | ||
}, | ||
{ | ||
"package": "TLS", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/tls.git", | ||
"version": "1.1.2" | ||
}, | ||
{ | ||
"package": "Turnstile", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/stormpath/Turnstile.git", | ||
"version": "1.0.6" | ||
}, | ||
{ | ||
"package": "Vapor", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/vapor.git", | ||
"version": "1.1.13" | ||
} | ||
], | ||
"version": 1 | ||
} |
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 @@ | ||
// swift-tools-version:3.1 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "server_swift_vapor", | ||
dependencies: [ | ||
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5) | ||
] | ||
) |
Oops, something went wrong.