Giter VIP home page Giter VIP logo

kitura-sample's Introduction

Kitura

A Swift Web Framework and HTTP Server

Docs Build Status - Master macOS Linux Apache 2 codecov codebeat badge Slack Status

Summary

Kitura is a web framework and web server that is created for web services written in Swift. For more information, visit www.kitura.dev.

Table of Contents

Features

  • URL routing (e.g., GET, POST, PUT, DELETE, PATCH)
  • Codable routing
  • URL parameters
  • Static file serving
  • FastCGI support
  • SSL/TLS support
  • Pluggable middleware

Getting Started

Visit https://www.kitura.dev for a Getting Started guide, tutorials, and API reference documentation.

Contributing to Kitura

All improvements to Kitura are very welcome! Here's how to get started with developing Kitura itself.

  1. Clone this repository.

$ git clone https://github.com/Kitura/Kitura

  1. Build and run tests.

$ swift test

You can find more info on contributing to Kitura in our contributing guidelines.

Notes

  • Swift-NIO is now the default network engine via the Kitura-NIO package. If for some reason you require the old Kitura-net package, you can still enable it by setting an environment variable KITURA_NIO=0 during build.
  • Most Kitura packages have been updated to require at least Swift 5.2 in order to maintain backward compatibility.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

kitura-sample's People

Contributors

acatighera avatar alvarobernalg avatar andrew-lees11 avatar bdhernand avatar carlbrown avatar craigkj312 avatar dfirsht avatar djones6 avatar dunncoding avatar frogcjn avatar helenmasters avatar ianpartridge avatar irar2 avatar kyemaloy97 avatar mamabusi avatar na-gupta avatar rfdickerson avatar rob-deans avatar rolivieri avatar shihabmehboob avatar shmuelk avatar taher-mosbah avatar vadimeisenbergibm avatar youming-lin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitura-sample's Issues

can't compile with DEVELOPMENT-SNAPSHOT-2016-06-06(the current recommended version)

Hi ~
The recommended version for now is DEVELOPMENT-SNAPSHOT-2016-06-06, and i'm on the develop branch but i still got some error while compiling 'Kitura':

Compile Swift Module 'Kitura' (34 sources)
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/MimeTypeAcceptor.swift:112:17: error: closure cannot implicitly capture an inout parameter unless @noescape
                criteriaMatches[type] = (priority: priority, qValue: parsedHeaderValue.qValue)
                ^
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/Router.swift:112:14: warning: result of call to 'all(_:middleware:)' is unused
        self.all(route, middleware: subrouter)
             ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/Router.swift:279:26: warning: result of call to 'send(fileName:)' is unused
            try response.send(fileName: resourceFileName)
                         ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/staticFileServer/FileServer.swift:105:17: warning: result of call to 'serveIfNonDirectoryFile(atPath:response:)' is unused
                serveIfNonDirectoryFile(atPath: filePathWithExtension, response: response)
                ^                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/staticFileServer/FileServer.swift:114:38: warning: result of call to 'redirect' is unused
                        try response.redirect(requestPath + "/")
                                     ^       ~~~~~~~~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/staticFileServer/FileServer.swift:146:30: warning: result of call to 'send(fileName:)' is unused
                try response.send(fileName: filePath)
                             ^   ~~~~~~~~~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:176:9: warning: result of call to 'send' is unused
        send(str)
        ^   ~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:191:9: warning: result of call to 'send(data:)' is unused
        send(data: data)
        ^   ~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:206:13: warning: result of call to 'send(data:)' is unused
            send(data: data)
            ^   ~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:245:9: warning: result of call to 'send(data:)' is unused
        send(data: data)
        ^   ~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:261:9: warning: result of call to 'send' is unused
        send(jsonStr)
        ^   ~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:287:14: warning: result of call to 'status' is unused
        self.status(status)
             ^     ~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:289:13: warning: result of call to 'send' is unused
            send(statusCode)
            ^   ~~~~~~~~~~~~
/Users/isan/Kitura-Sample/Packages/Kitura-0.17.8/Sources/Kitura/RouterResponse.swift:401:13: warning: result of call to 'send(fileName:)' is unused
        try send(fileName: download)
            ^   ~~~~~~~~~~~~~~~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a.xctoolchain/usr/bin/swift-build-tool -f /Users/isan/Kitura-Sample/.build/debug.yaml
make: *** [build] Error 1

Hello page crashed

Hi,

App crashed for unknown reason upon visiting /hello, see log below. Could'n reproduce it.
OS: sierra, browser: Safari 10.

UPDATE invoking /hello and / pages after each other might result in crash. Perhaps they interfere each other in a way (code is not thread safe?).

almacska:Kitura-Sample segabor$ ./.build/debug/KituraSample
 VERBOSE: run() Kitura.swift line 71 - Starting Kitura framework... 
 VERBOSE: run() Kitura.swift line 73 - Starting an HTTP Server on port 8090... 
 INFO: listen(socket:port:) HTTPServer.swift line 128 - Listening on port 8090 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:52500 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
fatal error: Index out of range
Current stack trace:
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:52503 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:52504 
0    libswiftCore.dylib                 0x00000001023fb580 swift_reportError + 132
1    libswiftCore.dylib                 0x0000000102418850 _swift_stdlib_reportFatalError + 61
2    libswiftCore.dylib                 0x0000000102214550 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
3    libswiftCore.dylib                 0x000000010238c600 partial apply for (_fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never).(closure #2) + 109
4    libswiftCore.dylib                 0x0000000102214550 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
5    libswiftCore.dylib                 0x0000000102347970 specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never + 96
6    libswiftCore.dylib                 0x00000001021fc830 _ArrayBuffer._checkInoutAndNativeTypeCheckedBounds(Int, wasNativeTypeChecked : Bool) -> () + 300
7    libswiftCore.dylib                 0x000000010220d510 Array.subscript.getter + 103
8    KituraSample                       0x0000000101db2730 IncomingSocketHandler.socketReaderQueue(fd : Int32) -> DispatchQueue + 159
9    KituraSample                       0x0000000101db3940 IncomingSocketHandler.handleBufferedReadData() -> () + 86
10   KituraSample                       0x0000000101dd9800 IncomingHTTPSocketProcessor.keepAlive() -> () + 260
11   KituraSample                       0x0000000101dd5c10 HTTPServerResponse.end() throws -> () + 164
12   KituraSample                       0x0000000101dd8490 protocol witness for ServerResponse.end() throws -> () in conformance HTTPServerResponse + 55
13   KituraSample                       0x0000000101e42530 RouterResponse.end() throws -> () + 2007
14   KituraSample                       0x0000000101e14c90 FileResourceServer.sendIfFound(resource : String, usingResponse : RouterResponse) -> () + 419
15   KituraSample                       0x0000000101e24a80 Router.process(request : RouterRequest, response : RouterResponse, callback : () -> ()) -> () + 1294
16   KituraSample                       0x0000000101e25410 Router.handle(request : ServerRequest, response : ServerResponse) -> () + 339
17   KituraSample                       0x0000000101e26220 protocol witness for ServerDelegate.handle(request : ServerRequest, response : ServerResponse) -> () in conformance Router + 64
18   KituraSample                       0x0000000101dd9650 IncomingHTTPSocketProcessor.(parsingComplete() -> ()).(closure #1) + 372
19   KituraSample                       0x0000000101db3090 thunk + 39
20   libdispatch.dylib                  0x00007fff9d9d0f53 _dispatch_call_block_and_release + 12
21   libdispatch.dylib                  0x00007fff9d9c8120 _dispatch_client_callout + 8
22   libdispatch.dylib                  0x00007fff9d9c9d04 _dispatch_root_queue_drain + 917
23   libdispatch.dylib                  0x00007fff9d9c9c54 _dispatch_worker_thread3 + 99
24   libsystem_pthread.dylib            0x00007fff9dc14233 _pthread_wqthread + 1299
25   libsystem_pthread.dylib            0x00007fff9dc14214 start_wqthread + 13
Illegal instruction: 4

Another log

almacska:Kitura-Sample segabor$ ./.build/debug/KituraSample
 VERBOSE: run() Kitura.swift line 71 - Starting Kitura framework... 
 VERBOSE: run() Kitura.swift line 73 - Starting an HTTP Server on port 8090... 
 INFO: listen(socket:port:) HTTPServer.swift line 128 - Listening on port 8090 




 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53102 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 ERROR: handleRead() IncomingSocketHandler.swift line 110 - Error code: -9983, Connection reset by peer 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53110 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53111 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53112 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53113 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53114 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53115 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53117 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 ERROR: write(from:length:) IncomingSocketHandler.swift line 262 - Write to socket (file descriptor 10 failed. Error number=32. Message=Broken pipe. 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53119 
 ERROR: handleRead() IncomingSocketHandler.swift line 110 - Error code: -9983, Connection reset by peer 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53125 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53126 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53127 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53128 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53129 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53197 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53200 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53201 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53202 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53203 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53204 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53205 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53206 
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53207 
 INFO: handle(request:response:next:) main.swift line 45 - Authorization: nil 
fatal error: Index out of range
Current stack trace:
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53208 
0    libswiftCore.dylib                 0x000000010bc20580 swift_reportError + 132
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53209 
1    libswiftCore.dylib                 0x000000010bc3d850 _swift_stdlib_reportFatalError + 61
2    libswiftCore.dylib                 0x000000010ba39550 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
3    libswiftCore.dylib                 0x000000010bbb1600 partial apply for (_fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never).(closure #2) + 109
4    libswiftCore.dylib                 0x000000010ba39550 specialized specialized StaticString.withUTF8Buffer<A> ((UnsafeBufferPointer<UInt8>) -> A) -> A + 355
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53210 
5    libswiftCore.dylib                 0x000000010bb6c970 specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never + 96
 INFO: listen(socket:port:) HTTPServer.swift line 133 - Accepted connection from: 127.0.0.1:53211 
6    libswiftCore.dylib                 0x000000010ba21830 _ArrayBuffer._checkInoutAndNativeTypeCheckedBounds(Int, wasNativeTypeChecked : Bool) -> () + 300
7    libswiftCore.dylib                 0x000000010ba32510 Array.subscript.getter + 103
8    KituraSample                       0x000000010b5d7730 IncomingSocketHandler.socketReaderQueue(fd : Int32) -> DispatchQueue + 159
9    KituraSample                       0x000000010b5d8940 IncomingSocketHandler.handleBufferedReadData() -> () + 86
10   KituraSample                       0x000000010b5fe800 IncomingHTTPSocketProcessor.keepAlive() -> () + 260
11   KituraSample                       0x000000010b5fac10 HTTPServerResponse.end() throws -> () + 164
12   KituraSample                       0x000000010b5fd490 protocol witness for ServerResponse.end() throws -> () in conformance HTTPServerResponse + 55
13   KituraSample                       0x000000010b667530 RouterResponse.end() throws -> () + 2007
14   KituraSample                       0x000000010b639c90 FileResourceServer.sendIfFound(resource : String, usingResponse : RouterResponse) -> () + 419
15   KituraSample                       0x000000010b649a80 Router.process(request : RouterRequest, response : RouterResponse, callback : () -> ()) -> () + 1294
16   KituraSample                       0x000000010b64a410 Router.handle(request : ServerRequest, response : ServerResponse) -> () + 339
17   KituraSample                       0x000000010b64b220 protocol witness for ServerDelegate.handle(request : ServerRequest, response : ServerResponse) -> () in conformance Router + 64
18   KituraSample                       0x000000010b5fe650 IncomingHTTPSocketProcessor.(parsingComplete() -> ()).(closure #1) + 372
19   KituraSample                       0x000000010b5d8090 thunk + 39
20   libdispatch.dylib                  0x00007fff9d9d0f53 _dispatch_call_block_and_release + 12
21   libdispatch.dylib                  0x00007fff9d9c8120 _dispatch_client_callout + 8
22   libdispatch.dylib                  0x00007fff9d9c9d04 _dispatch_root_queue_drain + 917
23   libdispatch.dylib                  0x00007fff9d9c9c54 _dispatch_worker_thread3 + 99
24   libsystem_pthread.dylib            0x00007fff9dc14233 _pthread_wqthread + 1299
25   libsystem_pthread.dylib            0x00007fff9dc14214 start_wqthread + 13
Illegal instruction: 4

No such file or directory [run] Error 1

When I try to run the project I get the following error.

running on macOS Sierra 10.12

$ make run
make SWIFT_BUILD_CONFIGURATION="debug" SWIFTC_FLAGS="-Xswiftc -DDEBUG" _build
--- Running build on Darwin
--- Build scripts directory: Package-Builder/build
--- Checking swift version
swift --version
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
--- Checking swiftc version
swiftc --version
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
--- Checking git version
git --version
git version 2.8.4 (Apple Git-73)
--- Checking git revision and branch
git rev-parse HEAD
710bc7b
git rev-parse --abbrev-ref HEAD
master
--- Invoking swift build
swift build -c debug -Xswiftc -DDEBUG
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'Bridging' (4 sources)
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'HeliumLogger' (1 sources)
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'SSLService' (1 sources)
Compile Swift Module 'Stencil' (15 sources)
Compile Swift Module 'KituraNet' (29 sources)
Compile Swift Module 'KituraStencil' (1 sources)
Compile Swift Module 'Mustache' (32 sources)
Compile Swift Module 'Kitura' (40 sources)
Compile Swift Module 'KituraMustache' (1 sources)
Compile Swift Module 'Kitura_Sample' (1 sources)
Linking ./.build/debug/Kitura-Sample
--- Invoking KituraSample executable
./.build/debug/KituraSample
make: ./.build/debug/KituraSample: No such file or directory
make: *** [run] Error 1

Update readme to tell user to not use the Download Zip from Github. Instead clone repo

Update readme to tell user to not use the Download Zip from Github. To instead clone the repo since the make run command assumes it's a git repo to download submodules

git clone --depth=1 https://github.com/IBM-Swift/Kitura-Sample.git

Steps to recreate

  1. Click Download Zip from Github Repo
  2. Unzip and open terminal
  3. Run make run
~/Downloads
⛄  $ cd Kitura-Sample-master
~/Downloads/Kitura-Sample-master
⛄  $ make run
--- Fetching Kitura-Build submodule
git submodule init
fatal: Not a git repository (or any of the parent directories): .git
make: *** No rule to make target `build', needed by `run'.  Stop.

Can't make sample on MacOS: error expected associated value for arg --configuration

Hi! This looks like a ton of fun, just have a question about a problem I'm seeing trying to install/build on macOS.

I downloaded Xcode Beta and the associated toolchain (both 3.0-PREVIEW-6 and the development snapshot from Aug 23rd). Added it to my path (see below) but am getting this error when I do make run:

error: expected associated value for argument: --configuration

Here's the full error:

--- Running build on Darwin
--- Build scripts directory: Package-Builder/build
--- Checking swift version
swift --version
Apple Swift version 3.0-dev (LLVM 17c4c6cf7a, Clang 4ca9e01a7c, Swift fa36206531)
Target: x86_64-apple-macosx10.9
--- Checking swiftc version
swiftc --version
Apple Swift version 3.0-dev (LLVM 17c4c6cf7a, Clang 4ca9e01a7c, Swift fa36206531)
Target: x86_64-apple-macosx10.9
--- Checking git version
git --version
git version 2.9.3
--- Checking git revision and branch
git rev-parse HEAD
0b3c002b0ed5dd087e9b10278c7f6c0cfad8a955
git rev-parse --abbrev-ref HEAD
master
--- Invoking swift build
swift build -c
error: expected associated value for argument: --configuration
enter `/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a.xctoolchain/usr/bin/swift-build --help' for usage information
make: *** [build] Error 1

Here's the contents of /Library/Developer/Toolchains:

drwxr-xr-x  7 root  wheel   238B Sep  2 11:58 swift-3.0-PREVIEW-6.xctoolchain
drwxr-xr-x  7 root  wheel   238B Sep  3 15:58 swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a.xctoolchain
lrwxr-xr-x  1 root  wheel    81B Sep  3 15:58 swift-latest.xctoolchain -> /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a.xctoolchain

And here's my PATH:

/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:/...<bunch of nvm and rvm junk>

Thanks for any help!

SwiftJWT example

We would like to add an example page for SwiftJWT.

This should use the updated Codable JWT which is being worked on in this pr

Current implementation is on this branch

master branch not working with build DEVELOPMENT-SNAPSHOT-2016-04-25-a

master branch not working with build DEVELOPMENT-SNAPSHOT-2016-04-25-a

git checkout master
make run
error: The dependency graph could not be satisfied because an update to `https://github.com/IBM-Swift/Kitura.git' is required
make: *** [build] Error 1
...

works on develop branch

make run failing with swift 3 2016-04-12-a

Install swift from https://swift.org/builds/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-osx.pkg

~/Downloads/Kitura-Sample-master/Kitura-Sample (master)
⛄  $ swift --version
Apple Swift version 3.0-dev (LLVM 752e1430fc, Clang 3987718dae, Swift 36739f7b57)
Target: x86_64-apple-macosx10.9
~/Downloads/Kitura-Sample-master/Kitura-Sample (master)
⛄  $ make run
--- Fetching Kitura-Build submodule
git submodule init
Submodule 'Kitura-Build' (https://github.com/IBM-Swift/Kitura-Build.git) registered for path 'Kitura-Build'
git submodule update --remote --merge
Cloning into 'Kitura-Build'...
remote: Counting objects: 347, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 347 (delta 1), reused 0 (delta 0), pack-reused 340
Receiving objects: 100% (347/347), 50.78 KiB | 0 bytes/s, done.
Resolving deltas: 100% (169/169), done.
Checking connectivity... done.
Submodule path 'Kitura-Build': checked out '383498d1d671fef434d0f57fcf82eef8ddea8c85'
--- Running build on Darwin
--- Build scripts directory: Kitura-Build/build
--- Checking swift version
swift --version
Apple Swift version 3.0-dev (LLVM 752e1430fc, Clang 3987718dae, Swift 36739f7b57)
Target: x86_64-apple-macosx10.9
--- Checking git revision and branch
git rev-parse HEAD
f7ecc863958cfcb7790b33840e3037981182c82e
git rev-parse --abbrev-ref HEAD
master
--- Invoking swift build
swift build -Xcc -fblocks -Xswiftc -I/usr/local/include -Xlinker -L/usr/local/lib
Cloning https://github.com/IBM-Swift/Kitura.git
Resolved version: 0.8.0
Cloning https://github.com/IBM-Swift/Kitura-net.git
Resolved version: 0.8.0
Cloning https://github.com/IBM-Swift/Kitura-sys.git
Resolved version: 0.8.0
Cloning https://github.com/IBM-Swift/LoggerAPI.git
Resolved version: 0.4.0
Cloning https://github.com/IBM-Swift/BlueSocket.git
Resolved version: 0.3.5
Cloning https://github.com/IBM-Swift/CCurl.git
Resolved version: 0.0.1
Cloning https://github.com/IBM-Swift/CHttpParser.git
Resolved version: 0.0.2
Cloning https://github.com/IBM-Swift/SwiftyJSON.git
Resolved version: 5.0.0
Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
Resolved version: 0.0.2
Cloning https://github.com/IBM-Swift/HeliumLogger.git
Resolved version: 0.4.3
Cloning https://github.com/IBM-Swift/Kitura-MustacheTemplateEngine.git
Resolved version: 0.8.0
Cloning https://github.com/IBM-Swift/GRMustache.swift.git
Resolved version: 1.1.1
Cloning https://github.com/IBM-Swift/Bridging.git
Resolved version: 0.2.0
Compiling Swift Module 'LoggerAPI' (1 sources)
Compiling Swift Module 'SwiftyJSON' (2 sources)
Compiling Swift Module 'Socket' (3 sources)
Compiling Swift Module 'Bridging' (1 sources)
Compiling Swift Module 'KituraTemplateEngine' (1 sources)
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/LoggerAPI-0.4.0/Sources/LoggerAPI/Logger.swift:39:24: error: missing argument label 'type:' in call
            logger?.log( .Verbose, msg: msg,
                       ^
                         type:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/LoggerAPI-0.4.0/Sources/LoggerAPI/Logger.swift:45:24: error: missing argument label 'type:' in call
            logger?.log( .Info, msg: msg,
                       ^
                         type:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/LoggerAPI-0.4.0/Sources/LoggerAPI/Logger.swift:51:24: error: missing argument label 'type:' in call
            logger?.log( .Warning, msg: msg,
                       ^
                         type:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/LoggerAPI-0.4.0/Sources/LoggerAPI/Logger.swift:57:24: error: missing argument label 'type:' in call
            logger?.log( .Error, msg: msg,
                       ^
                         type:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/LoggerAPI-0.4.0/Sources/LoggerAPI/Logger.swift:63:24: error: missing argument label 'type:' in call
            logger?.log( .Warning, msg: msg,
                       ^
                         type:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:645:35: warning: extraneous duplicate parameter name; 'family' already has an argument label
        public class func makeConfigured(family family: ProtocolFamily, type: SocketType, proto: SocketProtocol) throws -> Socket {
                                         ^~~~~~~

/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:680:29: warning: extraneous duplicate parameter name; 'nativeHandle' already has an argument label
        public class func makeFrom(nativeHandle nativeHandle: Int32, address: Address?) throws -> Socket {
                                   ^~~~~~~~~~~~~

/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:346:48: error: missing argument label 'value:' in call
                        guard let family = ProtocolFamily.getFamily(protocolFamily),
                                                                    ^
                                                                    value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:347:35: error: missing argument label 'value:' in call
                                let type = SocketType.getType(socketType),
                                                              ^
                                                              value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:348:42: error: missing argument label 'value:' in call
                                let pro = SocketProtocol.getProtocol(proto) else {
                                                                     ^
                                                                     value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:407:48: error: missing argument label 'value:' in call
                        guard let family = ProtocolFamily.getFamily(protocolFamily),
                                                                    ^
                                                                    value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:408:35: error: missing argument label 'value:' in call
                                let type = SocketType.getType(socketType),
                                                              ^
                                                              value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:409:42: error: missing argument label 'value:' in call
                                let pro = SocketProtocol.getProtocol(proto),
                                                                     ^
                                                                     value:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:535:19: error: value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') can never be nil, comparison isn't allowed
                                if readBuffer != nil {
                                   ~~~~~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1103:63: error: cannot pass immutable value as inout argument: implicit conversion from 'UnsafeMutablePointer<addrinfo>' to 'UnsafeMutablePointer<addrinfo>?' requires a temporary
                var status: Int32 = getaddrinfo(host, String(port), &hints, &targetInfo)
                                                                            ^~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1126:15: error: value of type 'UnsafeMutablePointer<addrinfo>' can never be nil, comparison isn't allowed
                while (info != nil) {
                       ~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1280:10: error: missing argument label 'set:' in call
                fdZero(&readfds)
                       ^
                       set:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1281:8: error: missing argument label 'fd:' in call
                fdSet(self.socketfd, set: &readfds)
                     ^
                      fd:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1284:10: error: missing argument label 'set:' in call
                fdZero(&writefds)
                       ^
                       set:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1285:8: error: missing argument label 'fd:' in call
                fdSet(self.socketfd, set: &writefds)
                     ^
                      fd:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1300:18: error: missing argument label 'fd:' in call
                return (fdIsSet(self.socketfd, set: &readfds), fdIsSet(self.socketfd, set: &writefds))
                               ^
                                fd:
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1372:62: error: cannot pass immutable value as inout argument: implicit conversion from 'UnsafeMutablePointer<addrinfo>' to 'UnsafeMutablePointer<addrinfo>?' requires a temporary
                let status: Int32 = getaddrinfo(nil, String(port), &hints, &targetInfo)
                                                                           ^~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1394:15: error: value of type 'UnsafeMutablePointer<addrinfo>' can never be nil, comparison isn't allowed
                while (info != nil) {
                       ~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1479:13: error: value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') can never be nil, comparison isn't allowed
                if buffer == nil || bufSize == 0 {
                   ~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1634:13: error: value of type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>') can never be nil, comparison isn't allowed
                if buffer == nil || bufSize == 0 {
                   ~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1728:28: error: value of optional type 'UnsafePointer<CodeUnit>?' not unwrapped; did you mean to use '!' or '?'?
                        try self.write(from: $0.baseAddress, bufSize: $0.count-1)
                                                ^
                                                           !
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1773:22: error: value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') can never be nil, comparison isn't allowed
                if self.readBuffer != nil {
                   ~~~~~~~~~~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1806:10: error: value of type 'NSMutableData' has no member 'appendBytes'
                                self.readStorage.appendBytes(self.readBuffer, length: count)
                                ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1118:18: error: value of type 'UnsafeMutablePointer<addrinfo>' can never be nil, comparison isn't allowed
                        if targetInfo != nil {
                           ~~~~~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/Socket-0.3.5/Sources/Socket.swift:1387:18: error: value of type 'UnsafeMutablePointer<addrinfo>' can never be nil, comparison isn't allowed
                        if targetInfo != nil {
                           ~~~~~~~~~~ ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1665:26: error: 'init(bool:)' is unavailable in Swift
private let trueNumber = NSNumber(bool: true)
                         ^~~~~~~~
Foundation.NSNumber:63:30: note: 'init(bool:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(bool value: Bool)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1666:27: error: 'init(bool:)' is unavailable in Swift
private let falseNumber = NSNumber(bool: false)
                          ^~~~~~~~
Foundation.NSNumber:63:30: note: 'init(bool:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(bool value: Bool)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:84:17: error: value of optional type 'NSErrorPointer' (aka 'Optional<AutoreleasingUnsafeMutablePointer<Optional<NSError>>>') not unwrapped; did you mean to use '!' or '?'?
                error.pointee = aError
                ^
                     ?
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:100:27: error: incorrect argument label in call (have 'usingEncoding:', expected 'using:')
        return string.data(usingEncoding: NSUTF8StringEncoding).flatMap({JSON(data: $0)}) ?? JSON(NSNull())
                          ^~~~~~~~~~~~~~
                           using
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1080:31: error: 'init(bool:)' is unavailable in Swift
                self.object = NSNumber(bool: newValue)
                              ^~~~~~~~
Foundation.NSNumber:63:30: note: 'init(bool:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(bool value: Bool)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1116:27: error: 'init(bool:)' is unavailable in Swift
            self.object = NSNumber(bool: newValue)
                          ^~~~~~~~
Foundation.NSNumber:63:30: note: 'init(bool:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(bool value: Bool)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1211:31: error: type 'NSDecimalNumber' has no member 'notA'
                if decimal == NSDecimalNumber.notA() {  // indicates parse error
                              ^~~~~~~~~~~~~~~ ~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1217:52: error: 'init(int:)' is unavailable in Swift
                return self.object as? NSNumber ?? NSNumber(int: 0)
                                                   ^~~~~~~~
Foundation.NSNumber:23:30: note: 'init(int:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(int value: Int32)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1219:24: error: 'init(double:)' is unavailable in Swift
                return NSNumber(double: 0.0)
                       ^~~~~~~~
Foundation.NSNumber:58:30: note: 'init(double:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(double value: Double)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1295:31: error: 'init(double:)' is unavailable in Swift
                self.object = NSNumber(double: newValue)
                              ^~~~~~~~
Foundation.NSNumber:58:30: note: 'init(double:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(double value: Double)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1307:27: error: 'init(double:)' is unavailable in Swift
            self.object = NSNumber(double: newValue)
                          ^~~~~~~~
Foundation.NSNumber:58:30: note: 'init(double:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(double value: Double)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1317:31: error: 'init(float:)' is unavailable in Swift
                self.object = NSNumber(float: newValue)
                              ^~~~~~~~
Foundation.NSNumber:53:30: note: 'init(float:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(float value: Float)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1329:27: error: 'init(float:)' is unavailable in Swift
            self.object = NSNumber(float: newValue)
                          ^~~~~~~~
Foundation.NSNumber:53:30: note: 'init(float:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(float value: Float)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1335:33: error: 'longValue' is unavailable in Swift
            return self.number?.longValue
                                ^~~~~~~~~
Foundation.NSNumber:30:16: note: 'longValue' has been explicitly marked unavailable here
    public var longValue: Int { get }
               ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1339:31: error: 'init(integer:)' is unavailable in Swift
                self.object = NSNumber(integer: newValue)
                              ^~~~~~~~
Foundation.NSNumber:69:30: note: 'init(integer:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(integer value: Int)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1348:25: error: value of type 'NSNumber' has no member 'integerValue'
            return self.numberValue.integerValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1351:27: error: 'init(integer:)' is unavailable in Swift
            self.object = NSNumber(integer: newValue)
                          ^~~~~~~~
Foundation.NSNumber:69:30: note: 'init(integer:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(integer value: Int)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1357:33: error: 'unsignedLongValue' is unavailable in Swift
            return self.number?.unsignedLongValue
                                ^~~~~~~~~~~~~~~~~
Foundation.NSNumber:32:16: note: 'unsignedLongValue' has been explicitly marked unavailable here
    public var unsignedLongValue: UInt { get }
               ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1361:31: error: 'init(unsignedLong:)' is unavailable in Swift
                self.object = NSNumber(unsignedLong: newValue)
                              ^~~~~~~~
Foundation.NSNumber:13:12: note: 'init(unsignedLong:)' has been explicitly marked unavailable here
    public init(unsignedLong value: UInt)
           ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1370:37: error: 'unsignedLongValue' is unavailable in Swift
            return self.numberValue.unsignedLongValue
                                    ^~~~~~~~~~~~~~~~~
Foundation.NSNumber:32:16: note: 'unsignedLongValue' has been explicitly marked unavailable here
    public var unsignedLongValue: UInt { get }
               ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1373:27: error: 'init(unsignedLong:)' is unavailable in Swift
            self.object = NSNumber(unsignedLong: newValue)
                          ^~~~~~~~
Foundation.NSNumber:13:12: note: 'init(unsignedLong:)' has been explicitly marked unavailable here
    public init(unsignedLong value: UInt)
           ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1379:31: error: value of type 'NSNumber' has no member 'charValue'
            return self.number?.charValue
                   ~~~~~~~~~~~^ ~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1383:31: error: 'init(char:)' is unavailable in Swift
                self.object = NSNumber(char: newValue)
                              ^~~~~~~~
Foundation.NSNumber:3:30: note: 'init(char:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(char value: Int8)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1392:25: error: value of type 'NSNumber' has no member 'charValue'
            return self.numberValue.charValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1395:27: error: 'init(char:)' is unavailable in Swift
            self.object = NSNumber(char: newValue)
                          ^~~~~~~~
Foundation.NSNumber:3:30: note: 'init(char:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(char value: Int8)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1401:31: error: value of type 'NSNumber' has no member 'unsignedCharValue'
            return self.number?.unsignedCharValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1405:31: error: 'init(unsignedChar:)' is unavailable in Swift
                self.object = NSNumber(unsignedChar: newValue)
                              ^~~~~~~~
Foundation.NSNumber:8:30: note: 'init(unsignedChar:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedChar value: UInt8)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1414:25: error: value of type 'NSNumber' has no member 'unsignedCharValue'
            return self.numberValue.unsignedCharValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1417:27: error: 'init(unsignedChar:)' is unavailable in Swift
            self.object = NSNumber(unsignedChar: newValue)
                          ^~~~~~~~
Foundation.NSNumber:8:30: note: 'init(unsignedChar:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedChar value: UInt8)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1423:31: error: value of type 'NSNumber' has no member 'shortValue'
            return self.number?.shortValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1427:31: error: 'init(short:)' is unavailable in Swift
                self.object = NSNumber(short: newValue)
                              ^~~~~~~~
Foundation.NSNumber:13:30: note: 'init(short:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(short value: Int16)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1436:25: error: value of type 'NSNumber' has no member 'shortValue'
            return self.numberValue.shortValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1439:27: error: 'init(short:)' is unavailable in Swift
            self.object = NSNumber(short: newValue)
                          ^~~~~~~~
Foundation.NSNumber:13:30: note: 'init(short:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(short value: Int16)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1445:31: error: value of type 'NSNumber' has no member 'unsignedShortValue'
            return self.number?.unsignedShortValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1449:31: error: 'init(unsignedShort:)' is unavailable in Swift
                self.object = NSNumber(unsignedShort: newValue)
                              ^~~~~~~~
Foundation.NSNumber:18:30: note: 'init(unsignedShort:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedShort value: UInt16)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1458:25: error: value of type 'NSNumber' has no member 'unsignedShortValue'
            return self.numberValue.unsignedShortValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1461:27: error: 'init(unsignedShort:)' is unavailable in Swift
            self.object = NSNumber(unsignedShort: newValue)
                          ^~~~~~~~
Foundation.NSNumber:18:30: note: 'init(unsignedShort:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedShort value: UInt16)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1467:33: error: cannot convert return expression of type 'Int?' to return type 'Int32?'
            return self.number?.intValue
                   ~~~~~~~~~~~~~^~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1471:31: error: 'init(int:)' is unavailable in Swift
                self.object = NSNumber(int: newValue)
                              ^~~~~~~~
Foundation.NSNumber:23:30: note: 'init(int:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(int value: Int32)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1480:37: error: cannot convert return expression of type 'Int' to return type 'Int32'
            return self.numberValue.intValue
                   ~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1483:27: error: 'init(int:)' is unavailable in Swift
            self.object = NSNumber(int: newValue)
                          ^~~~~~~~
Foundation.NSNumber:23:30: note: 'init(int:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(int value: Int32)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1489:31: error: value of type 'NSNumber' has no member 'unsignedIntValue'
            return self.number?.unsignedIntValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1493:31: error: 'init(unsignedInt:)' is unavailable in Swift
                self.object = NSNumber(unsignedInt: newValue)
                              ^~~~~~~~
Foundation.NSNumber:28:30: note: 'init(unsignedInt:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedInt value: UInt32)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1502:25: error: value of type 'NSNumber' has no member 'unsignedIntValue'
            return self.numberValue.unsignedIntValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1505:27: error: 'init(unsignedInt:)' is unavailable in Swift
            self.object = NSNumber(unsignedInt: newValue)
                          ^~~~~~~~
Foundation.NSNumber:28:30: note: 'init(unsignedInt:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedInt value: UInt32)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1511:31: error: value of type 'NSNumber' has no member 'longLongValue'
            return self.number?.longLongValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1515:31: error: 'init(longLong:)' is unavailable in Swift
                self.object = NSNumber(longLong: newValue)
                              ^~~~~~~~
Foundation.NSNumber:43:30: note: 'init(longLong:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(longLong value: Int64)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1524:25: error: value of type 'NSNumber' has no member 'longLongValue'
            return self.numberValue.longLongValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1527:27: error: 'init(longLong:)' is unavailable in Swift
            self.object = NSNumber(longLong: newValue)
                          ^~~~~~~~
Foundation.NSNumber:43:30: note: 'init(longLong:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(longLong value: Int64)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1533:31: error: value of type 'NSNumber' has no member 'unsignedLongLongValue'
            return self.number?.unsignedLongLongValue
                   ~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1537:31: error: 'init(unsignedLongLong:)' is unavailable in Swift
                self.object = NSNumber(unsignedLongLong: newValue)
                              ^~~~~~~~
Foundation.NSNumber:48:30: note: 'init(unsignedLongLong:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedLongLong value: UInt64)
                             ^
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1546:25: error: value of type 'NSNumber' has no member 'unsignedLongLongValue'
            return self.numberValue.unsignedLongLongValue
                   ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/Packages/SwiftyJSON-5.0.0/Source/SwiftyJSON.swift:1549:27: error: 'init(unsignedLongLong:)' is unavailable in Swift
            self.object = NSNumber(unsignedLongLong: newValue)
                          ^~~~~~~~
Foundation.NSNumber:48:30: note: 'init(unsignedLongLong:)' has been explicitly marked unavailable here
    public /*not inherited*/ init(unsignedLongLong value: UInt64)
                             ^
<unknown>:0: error: build had 3 command failures
error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a.xctoolchain/usr/bin/swift-build-tool -f /Users/csantanapr/Downloads/Kitura-Sample-master/Kitura-Sample/.build/debug.yaml default
make: *** [build] Error 1
~/Downloads/Kitura-Sample-master/Kitura-Sample (master)

Inner pages don't always load in firefox

When using Kitura-Sample in Firefox the inner pages sometimes don't load and you have to click multiple times. I believe this is due to the loadInnerPage function.

Could we look into using IFrames instead?

Get crash when build this project

$ swift build
Cloning https://github.com/IBM-Swift/Kitura.git
git clone --recursive --depth 10 https://github.com/IBM-Swift/Kitura.git /mnt/hgfs/SwiftServer/	Kitura-Sample/Packages/Kitura.git

fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0    libswiftCore.so                    0x00007fc96a26e8e0 swift_reportError + 117
1    libswiftCore.so                    0x00007fc96a27fe00 _swift_stdlib_reportFatalError + 61
2    libswiftCore.so                    0x00007fc96a08b8a3 <unavailable> + 0
3    libswiftCore.so                    0x00007fc96a1e8ffd <unavailable> + 0
4    libswiftCore.so                    0x00007fc96a08b8a3 <unavailable> + 0
5    libswiftCore.so                    0x00007fc96a1aa8b0 specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never + 96
6    swift-build                        0x00000000004933a5 <unavailable> + 0
7    swift-build                        0x0000000000650007 <unavailable> + 0
8    swift-build                        0x000000000065ee5d <unavailable> + 0
9    swift-build                        0x0000000000660b62 <unavailable> + 0
10   swift-build                        0x0000000000655d11 <unavailable> + 0
11   swift-build                        0x0000000000657c8e <unavailable> + 0
12   swift-build                        0x00000000006573ad <unavailable> + 0
13   swift-build                        0x0000000000657d5c <unavailable> + 0
14   libswiftCore.so                    0x00007fc96a12d0a0 Sequence.flatMap<A where ...> ((A.Iterator.Element) throws -> A1) throws -> [A1.Iterator.Element] + 576
15   swift-build                        0x0000000000653fac <unavailable> + 0
16   swift-build                        0x0000000000653984 <unavailable> + 0
17   swift-build                        0x000000000065c002 <unavailable> + 0
18   swift-build                        0x00000000006cd67b <unavailable> + 0
19   swift-build                        0x00000000006fd335 <unavailable> + 0
20   swift-build                        0x00000000004166d8 <unavailable> + 0
21   libc.so.6                          0x00007fc968245740 __libc_start_main + 240
22   swift-build                        0x0000000000416599 <unavailable> + 0
Illegal instruction



$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial


$ swift --version
Swift version 3.0.1 (swift-3.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Update the homepage to show routes available

The homepage needs to be rewritten to make it clear what routes are accessible to people using the web page. Some links to the routes available as well as a brief explanation would be perfect, will require defining a new custom route for /.

Create a web version of Kitura-Sample

We would like to run a version of Kitura-sample online so people can see it without having to clone the repo themselves. However, the current version of Kitura-Sample has a chat room and shared user input text. Since we don't want to moderate these we would like a version of Kitura-sample that is bound to each user which we can push to the cloud.

develop branch trying to 'make run' on OS X fails, Linux FINE

Submodule 'Kitura-Build' (https://github.com/IBM-Swift/Kitura-Build.git) registered for path 'Kitura-Build'
Cloning into '/Users/swiftly/Kitura-Sample/Packages/Kitura/Kitura-Build'...
error: no such remote ref f7b5be7f7f89215eadeda03ef8c4b42356f9221a
Fetched in submodule path 'Kitura-Build', but it did not contain f7b5be7f7f89215eadeda03ef8c4b42356f9221a. Direct fetching of that commit failed.

That is the error I get on several Mac's trying to just run the sample project without any changes? If I run it as a vagrant build it works just fine?

make run not working with Xcode 8 beta 3, please check

Compile CHTTPParser utils.c
Compile CHTTPParser http_parser.c
Compile Swift Module 'SwiftyJSON' (2 sources)
Compile Swift Module 'KituraTemplateEngine' (1 sources)
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'KituraSys' (3 sources)
Compile Swift Module 'HeliumLogger' (1 sources)
Linking CHTTPParser
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/SwiftyJSON-10.0.2/Source/SwiftyJSON.swift:1198:35: warning: expected ',' joining parts of a multi-clause condition
if let errorValue = error where errorValue.code == ErrorNotExist{
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/SwiftyJSON-10.0.2/Source/SwiftyJSON.swift:1155:57: error: cannot call value of non-function type 'NSDecimalNumber'
if decimal == NSDecimalNumber.notANumber() { // indicates parse error
~~~~~~~~~~~~~~~~~~~~~~~~~~^~

/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/SwiftyJSON-10.0.2/Source/SwiftyJSON.swift:1156:48: error: cannot call value of non-function type 'NSDecimalNumber'
return NSDecimalNumber.zero()
~~~~~~~~~~~~~~~~~~~~^~

/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:621:29: warning: expected ',' joining parts of a multi-clause condition
guard let sig = signature where isListening else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:645:29: warning: expected ',' joining parts of a multi-clause condition
guard let sig = signature where sig.port != Socket.SOCKET_INVALID_PORT else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:1474:5: warning: expected ',' joining parts of a multi-clause condition
where signature.port != Socket.SOCKET_INVALID_PORT else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:1816:5: warning: expected ',' joining parts of a multi-clause condition
where rc > 0 else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:1824:5: warning: expected ',' joining parts of a multi-clause condition
where rc > 0 else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:1903:34: warning: expected ',' joining parts of a multi-clause condition
guard let sig = self.signature where sig.proto == .udp else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:1940:34: warning: expected ',' joining parts of a multi-clause condition
guard let sig = self.signature where sig.proto == .udp else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:2119:34: warning: expected ',' joining parts of a multi-clause condition
guard let sig = self.signature where sig.proto == .udp else {
^~~~~
,
/Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/Packages/Socket-0.6.2/Sources/Socket.swift:2142:34: warning: expected ',' joining parts of a multi-clause condition
guard let sig = self.signature where sig.proto == .udp else {
^~~~~
,
:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode-8-Beta-3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/satheeshwaran/Documents/Personal/kitura/Kitura-Sample/.build/debug.yaml
make: *** [build] Error 1

`make run`

There is no makefile with which to do this.

Embed code examples and tutorials in Kitura-Sample

Context & Description

Over time, Kitura and associated repositories have built up a multitude of code examples and tutorials. This presents an ongoing maintenance problem: when APIs or the Swift language itself change, these examples can get out of date, and may fail to compile.

Proposal

  • Embed a copy of every code example and tutorial in Kitura-Sample
  • Add comments to each example in Kitura-Sample with a link to the corresponding copy in the documentation
  • Whenever a code example in Kitura-Sample requires updating, the documentation copy should be updated accordingly.

This is a significant task due to the number of code samples that currently are not represented in Kitura-Sample, however in the long term, it could mean that Kitura-Sample becomes the defacto place to prototype and test code samples, such that they are demonstrably correct at the point they are added to documentation.

Structuring the Kitura-Sample project

As there will be a large number of samples over time, we should consider the design of Kitura-Sample and how we would structure the project: for example, do we have separate targets for each 'feature' (optional repository) containing their code examples, and targets for each tutorial?

A benefit of separate targets would be that we can more accurately describe their dependencies so that, for example, the code for a single tutorial could be easily extracted as a standalone project.

Testing the samples

Consider whether we should add tests that exercise the code examples (may or may not be feasible, depending on whether they are complete enough to test).

What would an XCTest for a Kitura-Sample code example or tutorial look like?

Clear & Actionable Tasks

  • Agree a layout / project structure for Kitura-Sample
  • Strategy for testing code examples (XCTests?)
  • Identify the list of repositories in IBM-Swift that contain code examples, which are appropriate to represent in Kitura-Sample
  • Raise tasks for each repository to add the examples to the project, and confirm that they build and function correctly (tests added, if appropriate)

Exit Criteria:

This issue is complete once the following criteria are met:

  • Design of Kitura-Sample and tests are documented
  • Issues have been raised to cover each repo that needs adding to Kitura-Sample

Accessing /error segfaults the demo app

Running the sample app:

Swift version 3.0-dev (LLVM f54fa77021, Clang 0e6c928036, Swift e9d457540a)
Target: x86_64-unknown-linux-gnu

Visit: /error

Result: Server dies

Output:

ERROR: KituraSample main.swift line 88 - Example of error being set
[1]    12344 segmentation fault (core dumped)  ./.build/debug/KituraSample

I've spent 20 minutes with the framework at this point, but I don't think dropping core is the right behavior based on the main.swift file.

can't compile with recommended Swift version for Kitura

Hey there! After being to Swift London trying to start with Kitura (have a simple task to make a kind-of smart backend mockup for an app) but stuck even compiling this sample.

I've installed the recommended by main Kitura repo swift DEVELOPMENT-SNAPSHOT-2016-05-09.
And have a couple of errors during compilation of this project (seems that SwiftyJSON is the problem):

/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:124:14: error: cannot invoke 'JSON.init' with an argument list of type '([AnyObject])'
        self.init(jsonArray.map { $0.object })
             ^
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:124:14: note: overloads for 'JSON.init' exist with these partially matching parameter lists: (AnyObject), ([JSON]), ([String : JSON])
        self.init(jsonArray.map { $0.object })
             ^
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:143:14: error: cannot invoke 'JSON.init' with an argument list of type '([String : AnyObject])'
        self.init(dictionary)
             ^
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:143:14: note: overloads for 'JSON.init' exist with these partially matching parameter lists: (AnyObject), ([JSON]), ([String : JSON])
        self.init(dictionary)
             ^
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:296:29: error: return expression of type '[AnyObject]' does not conform to 'AnyObject'
                return self.rawArray
                       ~~~~~^~~~~~~~
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:298:29: error: return expression of type '[String : AnyObject]' does not conform to 'AnyObject'
                return self.rawDictionary
                       ~~~~~^~~~~~~~~~~~~
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:300:29: error: return expression of type 'String' does not conform to 'AnyObject'
                return self.rawString
                       ~~~~~^~~~~~~~~
/Users/asdfgh1/tmp/Kitura-Sample/Packages/SwiftyJSON-7.0.4/Source/SwiftyJSON.swift:332:94: error: cannot convert value of type 'String' to expected dictionary key type 'NSObject'
                _error = NSError(domain: ErrorDomain, code: ErrorUnsupportedType, userInfo: [NSLocalizedDescriptionKey: "It is a unsupported type"])
                                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~

Build Failure

When trying to build the Sample Application on Linux the following error occurs

Swift version 3.0-dev (LLVM b9bd56d1b8, Clang 61576bc3fb, Swift 44b8a0bd12)
Target: x86_64-unknown-linux-gnu

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/SwiftyJSON-14.2.0/Source/SwiftyJSON.swift:1176:27: warning: expression implicitly coerced from 'String._ObjectType?' to Any
            self.object = newValue?.absoluteString._bridgeToObjectiveC()
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/SwiftyJSON-14.2.0/Source/SwiftyJSON.swift:1176:52: note: provide a default value to avoid this warning
            self.object = newValue?.absoluteString._bridgeToObjectiveC()
                          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
                                                                         ?? <#default value#>
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/SwiftyJSON-14.2.0/Source/SwiftyJSON.swift:1176:52: note: force-unwrap the value to avoid this warning
            self.object = newValue?.absoluteString._bridgeToObjectiveC()
                          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
                                                                        !
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/SwiftyJSON-14.2.0/Source/SwiftyJSON.swift:1176:52: note: explicitly cast to Any with 'as Any' to silence this warning
            self.object = newValue?.absoluteString._bridgeToObjectiveC()
                          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
                                                                         as Any
Compile Swift Module 'Stencil' (15 sources)
Compile Swift Module 'KituraStencil' (1 sources)
Compile Swift Module 'KituraNet' (29 sources)
Compile Swift Module 'Kitura' (40 sources)
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs+Error.swift:28:35: error: @escaping attribute may only be used in function parameter position
    public func error(_ handler: @escaping RouterHandler...) -> Router {
                                 ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouteRegex.swift:24:39: error: use of undeclared type 'RegularExpression'
    typealias RegularExpressionType = RegularExpression
                                      ^~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterElement.swift:33:28: error: use of undeclared type 'RegularExpression'
        private var regex: RegularExpression?
                           ^~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:31:52: error: @escaping attribute may only be used in function parameter position
    public func all(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                  ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:88:52: error: @escaping attribute may only be used in function parameter position
    public func get(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                  ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:145:53: error: @escaping attribute may only be used in function parameter position
    public func head(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                   ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:202:53: error: @escaping attribute may only be used in function parameter position
    public func post(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                   ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:259:52: error: @escaping attribute may only be used in function parameter position
    public func put(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                  ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:316:55: error: @escaping attribute may only be used in function parameter position
    public func delete(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                     ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:373:56: error: @escaping attribute may only be used in function parameter position
    public func options(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                      ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:430:54: error: @escaping attribute may only be used in function parameter position
    public func trace(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                    ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:487:53: error: @escaping attribute may only be used in function parameter position
    public func copy(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                   ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:544:53: error: @escaping attribute may only be used in function parameter position
    public func lock(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                   ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:601:54: error: @escaping attribute may only be used in function parameter position
    public func mkCol(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                    ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:658:53: error: @escaping attribute may only be used in function parameter position
    public func move(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                   ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:715:54: error: @escaping attribute may only be used in function parameter position
    public func purge(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                    ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:772:57: error: @escaping attribute may only be used in function parameter position
    public func propFind(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                       ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:829:58: error: @escaping attribute may only be used in function parameter position
    public func propPatch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                        ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:886:55: error: @escaping attribute may only be used in function parameter position
    public func unlock(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                     ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:943:55: error: @escaping attribute may only be used in function parameter position
    public func report(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                     ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1000:59: error: @escaping attribute may only be used in function parameter position
    public func mkActivity(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                         ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1057:57: error: @escaping attribute may only be used in function parameter position
    public func checkout(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                       ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1114:54: error: @escaping attribute may only be used in function parameter position
    public func merge(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                    ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1171:56: error: @escaping attribute may only be used in function parameter position
    public func mSearch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                      ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1228:55: error: @escaping attribute may only be used in function parameter position
    public func notify(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                     ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1285:58: error: @escaping attribute may only be used in function parameter position
    public func subscribe(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                        ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1342:60: error: @escaping attribute may only be used in function parameter position
    public func unsubscribe(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                          ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1399:54: error: @escaping attribute may only be used in function parameter position
    public func patch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                    ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1456:55: error: @escaping attribute may only be used in function parameter position
    public func search(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                     ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterHTTPVerbs_generated.swift:1513:56: error: @escaping attribute may only be used in function parameter position
    public func connect(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router {
                                                      ~^~~~~~~~~~~~~~~~~~~~~

/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterElement.swift:33:28: error: use of undeclared type 'RegularExpression'
        private var regex: RegularExpression?
                           ^~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterElement.swift:33:28: error: use of undeclared type 'RegularExpression'
        private var regex: RegularExpression?
                           ^~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouteRegex.swift:24:39: error: use of undeclared type 'RegularExpression'
    typealias RegularExpressionType = RegularExpression
                                      ^~~~~~~~~~~~~~~~~
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterRequest.swift:56:33: error: use of unresolved identifier 'RegularExpression'
                let regex = try RegularExpression(pattern: pattern, options: [.caseInsensitive])
                                ^~~~~~~~~~~~~~~~~
Foundation.NSRegularExpression:1:12: note: did you mean 'NSRegularExpression'?
open class NSRegularExpression : Foundation.NSObject, NSCopying, NSCoding {
           ^
/home/sknitelius/ClionProjects/Kitura-Sample/Packages/Kitura-1.0.0/Sources/Kitura/RouterElement.swift:33:28: error: use of undeclared type 'RegularExpression'
        private var regex: RegularExpression?
                           ^~~~~~~~~~~~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/sknitelius/swift-DEVELOPMENT-SNAPSHOT-2016-10-06-a-ubuntu16.04/usr/bin/swift-build-tool -f /home/sknitelius/ClionProjects/Kitura-Sample/.build/debug.yaml
Package-Builder/build/Makefile:49: recipe for target '_build' failed
make[1]: *** [_build] Error 1
make[1]: Leaving directory '/home/sknitelius/ClionProjects/Kitura-Sample'
Package-Builder/build/Makefile:41: recipe for target 'buildDebug' failed
make: *** [buildDebug] Error 2

Re-introduce ORM samples with dummy database plugin

#109 removed the ORM examples from Kitura-Sample as it otherwise requires users to install Postgres dependencies.

However, Kitura-Sample could include ORM and Kuery samples that work out-of-the-box, by using a 'dummy' database plugin (something that is backed by a simple in-memory structure for example).

I believe such a thing is already implemented in the Kuery tests. Could we use this as the basis of something simple that would provide enough functionality for the purposes of the sample?

... usr/bin/swift-build (No such file or directory)

I follow all the steps for Kitura installation, but when I do

make run

It throws an error with following description

--- Invoking swift build
swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.