💧 A server-side Swift web framework.

Last update: Jun 23, 2022

Vapor

Documentation Team Chat MIT License Continuous Integration Swift 5.2 Twitter


Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project.

Take a look at some of the awesome stuff created with Vapor.

💧 Community

Join the welcoming community of fellow Vapor developers on Discord.

🚀 Contributing

To contribute a feature or idea to Vapor, create an issue explaining your idea or bring it up on Discord.

If you find a bug, please create an issue.

If you find a security vulnerability, please contact [email protected] as soon as possible.

💛 Sponsors

Support Vapor's development by becoming a sponsor.

Monstarlab Skelpo Transeo Gwynne Raskind Joannis Orlandos Kyle Browning Jari omrd

💚 Backers

Support Vapor's development by becoming a backer.

analytics

GitHub

https://github.com/vapor/vapor
Comments
  • 1. Vapor 3 async changes before alpha

    Discussion topics:

    • Stream notifications for errors
    • Stream close notification
    • Cascading notifications throughout streams (up the stream and/or down the stream)
    • Multiple future types
    • Lightweight versus easy to use futures
    • Timing out promises efficiently
    • Helpers for managing tasks on the event loop

    These topics explained from top to bottom:

    Error stream notifications

    Currently, stream notifications are handled by registering a closure. You can set a closure on the receiving/draining end of the stream, the result. But anywhere else will break the error chain unless explicitly passed on. This also prevents errors from cascading back. An error in TCP will trigger later in the process of handling the HTTP request, but the other way around doesn't work (Database errors cascading to the HTTP layer). That is still a useful feature, for example, for throwing 500 pages by default.

    let requests = socket.stream(to: HTTPParser)
    let responses = request.stream(to: myApp)
    responses.stream(to: socket)
    
    responses.catch { error in
      print("500 error")
    }
    
    // At this moment, the socket does not find any errors, nor do the parser serializer
    

    Stream close notifications

    Closing streams is handled the same way, currently. We should decide if we want to keep that this way.

    // WebSocket.swift
    socket.onClose = {
      websocket.sendCloseMessage()
    }
    
    // WebSocket+SSL.swift
    socket.onClose = {
      tls.deinitialize()
    }
    
    // Chat.swift
    socket.onClose = {
      friends.notifyOfflineStatus()
    }
    

    Cascading notifications

    As discussed in the error stream notification, cascading these errors can interrupt a process causing no additional unnecessary work to be executed. But this must be implemented with care. Interrupting in the middle of a registration form (adding the database entry, sending the email and 2 other ops) can prevent some ops from executing whilst others did execute.

    There should be sensible helpers for that.

    drop.get {
      return database.all(User.self, in: "SELECT * FROM users")
    }
    
    class ErrorMiddleware: Middleware {
      func handle(request: Request, chainingTo responder: Responder) -> Future<Response> {
        let promise = Promise<Response>()
    
        return responder.respond(to: request).do(promise.complete).catch {
            promise.complete(Response(status: 500))
        }
    
        return promise.future
      }
    }
    

    Multiple future types

    As of right now, futures are really easy to use and sensible. They conform to FutureType allowing extensibility and more (generic) integration. One such example is the conformance of Response to FutureType, effectively making Future(Response(...)) unnecessary bloat.

    Pseudocode Problem

    let users = database.all(User.self, in: "SELECT * FROM users LIMIT 100") // [User].count == 100
    

    If User is a struct of 10KB, [User] will be copied around 2 times with an overhead. Once to the future, once from the future to the handler. This copies around 2MB of extra data.

    Timing out promises

    Promises can be timed out whilst blocking, currently. But you cannot easily dispatch a task like this without manually interfacing with the DispatchQueue in a worker's eventloop. Having to block for waiting is not sensible, and against the async design. If an HTTP request is waiting for >30 and especially >60 seconds, you're pretty much guaranteed to have timed out. And if any client-side operation done by Vapor (such as calling stripe) times out after X seconds, we shouldn't keep the promise unfulfilled in memory.

    Use case

    // Throws a timeout after 5 seconds of waiting for a result
    return websocket.connect(to: "ws://localhost:8080/").map(timeout: .seconds(5)) { websocket in
      ...
    }
    

    Helpers for managing tasks

    Finally, playing into this last topic. Many people are using websockets or other features that require cron-jobs. Some people may want to send a notification every minute for new chat messages, regardless of circumstances. Or send a ping to the client every 15 seconds to keep the connection open. They're very common use cases and should be covered from the start, especially with async.

    Use case

    websocket.worker.every(.seconds(15)) {
      // keep the connection alive
      websocket.ping()
    }
    
    Reviewed by Joannis at 2017-11-02 10:06
  • 2. Push Notification for iOS and Web

    Notification Service Extension is an interesting feature that can send plaintext or rich push notifications to iOS.

    Is it available on Linux and macOS server side beside the pubsub method?

    Reviewed by wildfiremedia at 2016-09-15 08:07
  • 3. Server doesn't stop succesfully in CLI after opening WebSocket connections

    Steps to reproduce

    Create a simple Vapor app that opens WebSocket connections:

    import Vapor
    
    extension Application {
      func configure(
        onWebSocketOpen: @escaping (WebSocket) -> (),
        onWebSocketClose: @escaping (WebSocket) -> ()
      ) {
        webSocket("watcher") { _, ws in
          onWebSocketOpen(ws)
          ws.onClose.whenComplete { _ in onWebSocketClose(ws) }
        }
      }
    }
    
    final class Server {
      private struct Lifecycle: LifecycleHandler {
        weak var server: Server?
    
        /// Closes all active WebSocket connections
        func shutdown(_ app: Application) {
          try! EventLoopFuture<()>.andAllSucceed(
            server?.connections.map { $0.close() } ?? [],
            on: app.eventLoopGroup.next()
          ).wait()
          print("shutdown finished")
        }
      }
    
      private var connections = Set<WebSocket>()
      private let app: Application
    
      init() throws {
        var env = Environment(name: "development", arguments: ["vapor"])
        try LoggingSystem.bootstrap(from: &env)
        app = Application(env)
        app.configure(
          onWebSocketOpen: { [weak self] in
            self?.connections.insert($0)
          },
          onWebSocketClose: { [weak self] in
            self?.connections.remove($0)
          }
        )
      }
    
      /// Blocking function that starts the HTTP server
      func run() throws {
        defer { app.shutdown() }
        app.lifecycle.use(Lifecycle(server: self))
        try app.run()
      }
    }
    
    try Server().run()
    

    Expected behavior

    When this server app is started from command-line and any WebSocket connections are established, the server process can stopped quickly with Ctrl-C.

    Actual behavior

    The server process can't be stopped quickly with Ctrl-C. It hangs for about 5 seconds or so and then raises the following error:

    shutdown finished
    [ ERROR ] Could not stop HTTP server: Abort.500: Server stop took too long.
    ERROR: Cannot schedule tasks on an EventLoop that has already shut down. This will be upgraded to a forced crash in future SwiftNIO versions.
    

    Environment

    These are the details of revelant package dependencies from Package.resolved:

          {
            "package": "vapor",
            "repositoryURL": "https://github.com/vapor/vapor.git",
            "state": {
              "branch": null,
              "revision": "88293674e2ea017691c56af20d0938dfff7ece04",
              "version": "4.27.0"
            }
          },
          {
            "package": "websocket-kit",
            "repositoryURL": "https://github.com/vapor/websocket-kit.git",
            "state": {
              "branch": null,
              "revision": "b0736014be634475dac4c23843811257d86dcdc1",
              "version": "2.1.1"
            }
          }
    
    • Vapor Framework version: 4.27.0, but this was reproducible in versions as old as 4.5.0
    • Vapor Toolbox version: not installed
    • OS version: macOS 10.15.6
    Reviewed by MaxDesiatov at 2020-07-24 15:26
  • 4. Make number of threads in app.threadPool configurable

    The Vapor 4.0 documentation of "Async" suggest to run any blocking work in the background, such that several clients won't block each other. I've set up a new project from scratch and registered two routes:

    app.get("hello-again") { req -> String in
        print("hello-again requested")
    
        return "Hello, world, again!"
    }
    
    app.get("hello") { req -> EventLoopFuture<String> in
        print("hello requested")
        let promise = req.eventLoop.makePromise(of: Void.self)
    
        req.application.threadPool.submit { _ in
            sleep(5)
            print("(did some work)")
    
            promise.succeed(Void())
        }
    
        return promise.futureResult.transform(to: "Hello, world!")
    }
    

    If I request GET/hello and immediately GET/hello-again, GET/hello-again is served directly as expected. But if I request GET/hello and than immediately a second GET/hello, the second request waits for the first one to complete. Thus, the output in my console is:

    [ INFO ] GET /hello
    hello requested
    (did some work)
    [ INFO ] GET /hello
    hello requested
    (did some work)
    

    But from the documentation I would have rather expected:

    [ INFO ] GET /hello
    hello requested
    [ INFO ] GET /hello
    hello requested
    (did some work)
    (did some work)
    

    What am I missing?

    Reviewed by devnikkin at 2020-04-11 09:56
  • 5. Resource temporarily unavailable after 30 seconds

    Another socket issue that occurs after 30 seconds. It happens on Ubuntu 16.04 with Swift 3.0.1 and Vapor 1.1.10 on an EC2 instance running behind an Elastic Load Balancer:

    Server error: dispatch(Transport.StreamError.receive("There was a problem while receiving data.", Socket failed with code 11 ("Resource temporarily unavailable") [readFailed] "Unknown error"))

    Is it important or can we silence that error, too?

    Reviewed by skreutzberger at 2016-11-04 10:19
  • 6. Injecting dependencies into ResourceControllers

    How am I supposed to do this? Vapor requires me to register a type as a controller, not an object. The Controller protocol dictates this type should have a default initializer. Vapor then uses this initializer to create an object right before it calls one of the index, store, ... methods on it. This means I can't inject anything into the object because I can't initialize it.

    Wouldn't it be better to register an object as a controller, instead of a type? That's the way Blackfish does it, meaning I can inject my dependencies (model) via the initializer as follows (Blackfish code):

    app.use(path: "/api/students", controller: StudentsApiController(model: model))
    
    Reviewed by svanimpe at 2016-03-06 21:06
  • 7. Couldn't install vapor with homebrew "libssl.1.0.0.dylib not loaded"

    Steps to reproduce

    Tried installing vapor with homebrew with the official docs. Running all commands in zsh:

    brew tap vapor/tap
    brew install vapor/tap/vapor
    vapor --help
    

    Expected behavior

    vapor --help running properly without errors

    Actual behavior

    Screenshot 2019-11-24 at 01 09 41

    Environment

    • Vapor Framework version:
    • Vapor Toolbox version: /usr/local/Cellar/vapor/3.1.10
    • OS version: MacOS 10.14.6
    Reviewed by lil5 at 2019-11-24 00:19
  • 8. Xcode - no such module Vapor

    Hello, when I was trying to set up a small a vapor project I ran into an issue with the xcode project that gets created. I ran vapor new dragons, cd dragons, vapor xcode. When the xcode project opened up, I added a new file "Battles.swift" to the models folder, and edited the main.swift file to code in the image below. When I tried to build the app via xcode, I got this error "No such module 'Vapor'. " However, I was still able to build and run the vapor project via the command line. Not quite sure what the problem is. It might just be my machine. Any help would be appreciated. Thanks

    Reviewed by shayneptorres at 2016-11-22 19:31
  • 9. tls server

    • Vapor Version: 2.0
    • OS: macOS Sierra
    • OS Version: 10.12.6
    • Vapor Toolbox Version: 2.0.4

    the ServerSocket.swift in TLS module the function accept()->Self return self i changed it like this at the end of the function

        let c = InternetSocket(client, context)
        c.cSSL = ssl
        return c
    

    but then server always report error like this

    Server error: dispatch(Transport Layer Security Error: Undefined error: 0
    
    Identifier: TLS.TLSError.SSL_read (0))
    GET /info
    Server error: dispatch(Transport Layer Security Error: The operation did not complete; the same TLS/SSL I/O function should be called again later.
    
    Identifier: TLS.TLSError.SSL_read (-1))
    

    so it can't keep connect alive

    Reviewed by vcxk at 2017-10-16 06:13
  • 10. localization

    I18n support

    Introduction

    I don't think this feature needs an introduction actually; all of us know what internationalization is and why it's important for Vapor to support it. Anyway, in case this paragraph is mandatory: Vapor needs to support internationalization in order to become the greatest Swift based web framework. 😄

    Motivation

    One of the key features of every professional web framework is the I18n support. Right now Vapor lacks this feature and I think adding this we can make Vapor to be one step closer to the level of others web frameworks around the web.

    Proposed solution

    I believe the best place for the dictionaries is under the Resources/Locales folder. The structure to be used to separate each language is quite simple: a folder with the language code (es, en, jp, etc.) and as much files as the developer wants to organise its dictionaries under those folders.

    As Vapor has JSON format config files already, I propose to use this file format to store the dictionaries, so we can read them natively.

    An I18n class is going to take care about locales and site language switching.

    Code snippets

    I propose the static func t(_: String) method to do the translation of the key passed as argument.

    I18n.t('foo.bar')
    

    As you can see it's quite straightforward. That method just search for the key in the corresponding locale folder.

    The static func changeLanguage(_: String) method will change the current selected locale to the language code passed as parameter in the call.

    I18n.changeLanguage('en')
    

    Impact

    As I18n class is quite atomic I don't expect any impact to Vapor applications.

    Alternatives considered

    I think about using yaml instead json due to the vast use of yaml format in web frameworks but json is natively supported by Swift so Vapor get less dependencies to third party libraries this way.

    Decision (For Moderator Use)

    On May 26th, 2016, the community decided to approve this proposal.

    Reviewed by kerunaru at 2016-05-14 15:55
  • 11. improve git functionality for `vapor new`

    Currently every project created with vapor new is based on the vapor example project. That results in boilerplate code which is more suitable for demonstration purposes than actual starting ground for new projects. In example the mustache example functionality and dependency likely is going to be removed every time.

    The solution would be to introduce the example argument for the vapor command line application, which creates an new project based on the example. In parallel the new argument will be modified to create a barebone project with just the minimal content necessary to get going (requires a new repository as a source). In addition there is an option (argument --template, other suggestions welcome) to specify the repository to use as the template for creating a new project.

    This enables new starting points when creating new projects.

    Example

    vapor new Vaporizer
    

    Creates a new project in the Vaporizer directory based on the minimal, default project template. Invokes dependency installation and build automatically (vapor build).

    vapor new Vaporizer --template=https://github.com/alomvar/vapor-blog-template
    

    Creates a new project in the Vaporizer directory based on the provided project template (a Git repository). Invokes dependency installation and build automatically (vapor build).

    vapor example
    

    Creates a new project in VaporExample based on the official Vapor example project. Invokes dependency installation and build automatically (vapor build) and runs it afterwards.

    Reviewed by peterthomashorn at 2016-05-06 21:44
  • 12. Is quiescing working?

    Describe the bug

    I've been trying to figure out why it's impossible to gracefully shutdown a Vapor HTTP/2 server in code without terminating the process. I can get the port to close, but long-running requests will still continue and won't have their underlying channels closed.

    To debug this, I've been looking into how quiescing is handled.

    I've noticed, that I'm not able to produce any scenario in which ChannelShouldQuiesceEvent reaches one of the channel handlers that's actually supposed to handle it. The only handler that will ever see this event is HTTPServerErrorHandler, which doesn't seem correct. I've messed with the code a fair bit, and cannot get this event to propagate to other handlers.

    It looks like quiescing is broken in Vapor. I'm still not fully versed on the inner workings/design of NIO, so could someone with a deeper understanding take a look?

    Reviewed by lmcd at 2022-06-10 15:08
  • 13. Vapor randomly stops accepting external connections on macOS

    Describe the bug

    After a long period of time (e.g. a 4-5 days), our server will stop accepting connections outside the machine. Local connections will still respond, but external ones will just stall and timeout.

    This seems to be some kind of networking issue. A basic, simple Vapor 'hello world' endpoint will have the same issue, so it's not anything application-specific.

    No other services on the Mac (e.g. SSH) have this problem - only Vapor. A way of gracefully soft-restarting the server would help mitigate this, but this is broken in Vapor too, so a hard quit of the process is the only resolution.

    Environment

    • Vapor Framework version: latest
    • Vapor Toolbox version: latest
    • OS version: macOS 12.3.1

    Additional context

    Add any other context about the problem here.

    Reviewed by lmcd at 2022-06-08 17:42
  • 14. Docker deployment instructions don't match template docker files

    Describe the bug

    The Docker deployment instructions don't match template docker files. For example, the instructions talk about some environment variables being defined at the top of docker-compose.yml, but most of those are not actually defined in the template file.

    To Reproduce

    1. Follow the instructions to create the template app2.
    2. Look at the resulting files and compare to instructions.3.
    Reviewed by JetForMe at 2022-06-04 05:55
  • 15. Add fuzzing tests

    We should investigate adding some automated fuzzing tests that run say once a week on main to explore Vapor's integrity. That could help us catch any application crashes like https://github.com/vapor/vapor/security/advisories/GHSA-vj2m-9f5j-mpr5

    Reviewed by 0xTim at 2022-05-31 10:14
  • 16. brew install vapor compile error

    Describe the bug

    I use brew install vapor/tap/vapor to install vapor, but i get compile error.

    To Reproduce

    1, Xcode Version 13.3 2, Mac OS Version 12.3 3,Homebrew 3.4.11-34-gc20b3ab Homebrew/homebrew-core (git revision 1b4baeeddb; last commit 2021-02-08) Homebrew/homebrew-cask (git revision 3a77e334e4; last commit 2022-05-16)

    Error: brew install vapor/tap/vapor
    ==> Downloading https://github.com/vapor/toolbox/archive/18.0.0.tar.gz Already downloaded: /Users/jiaxiangli/Library/Caches/Homebrew/downloads/a4d3c11ed4b9d0aa51eaf5b9b88cfcd1b357a41b6d06ee739e7050a90963ca51--18.0.0.tar.gz ==> Installing vapor from vapor/tap ==> swift build --disable-sandbox -c release -Xswiftc -cross-module-optimization Last 15 lines from /Users/user/Library/Logs/Homebrew/vapor/01.swift: ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift:37:26: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol Console: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:32: warning: initialization of 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') results in a dangling pointer versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: implicit argument conversion from 'yaml_version_directive_t' (aka 'yaml_version_directive_s') to 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') produces a pointer valid only for the duration of the call to 'init(_:)' versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^~~~~~~~~~~~~~~~~~~~~~ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: use 'withUnsafeMutablePointer' in order to explicitly convert argument to pointer valid for a defined scope versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^

    If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): https://github.com/vapor/homebrew-tap/issues

    Build logs:

    2022-05-17 03:03:29 +0000

    swift build --disable-sandbox -c release -Xswiftc -cross-module-optimization

    warning: Failed creating default security location, Error Domain=NSCocoaErrorDomain Code=513 "“security” couldn’t be removed because you don’t have permission to access it." UserInfo={NSUserStringVariant=( Remove ), NSFilePath=/Users/jiaxiangli/.swiftpm/security, NSUnderlyingError=0x6000010b2310 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} warning: Failed creating default configuration location, other(1) warning: Failed creating default cache location, other(1) Fetching https://github.com/jpsim/Yams.git Fetching https://github.com/apple/swift-nio.git Fetching https://github.com/tanner0101/mustache.git [1/75] Fetching objects Fetched https://github.com/apple/swift-nio.git (660.02s) Fetched https://github.com/jpsim/Yams.git (660.02s) Fetched https://github.com/tanner0101/mustache.git (660.02s) Fetching https://github.com/vapor/console-kit.git Fetching https://github.com/apple/swift-log.git Fetched https://github.com/apple/swift-log.git (120.74s) Fetched https://github.com/vapor/console-kit.git (120.85s) Fetching https://github.com/vapor/console-kit.git Fetched https://github.com/vapor/console-kit.git (6.36s) Computing version for https://github.com/vapor/console-kit.git Computed https://github.com/vapor/console-kit.git at 4.1.1 (3.38s) Fetching https://github.com/apple/swift-log.git Fetched https://github.com/apple/swift-log.git (16.19s) Computing version for https://github.com/tanner0101/mustache.git Computed https://github.com/tanner0101/mustache.git at 0.1.0 (1.27s) Updating https://github.com/apple/swift-log.git Computing version for https://github.com/jpsim/Yams.git Updated https://github.com/apple/swift-log.git (1.65s) Computed https://github.com/jpsim/Yams.git at 2.0.0 (2.69s) Computing version for https://github.com/apple/swift-nio.git Computed https://github.com/apple/swift-nio.git at 2.18.0 (1.08s) Computing version for https://github.com/apple/swift-log.git Computed https://github.com/apple/swift-log.git at 1.2.0 (0.90s) Creating working copy for https://github.com/apple/swift-log.git Working copy of https://github.com/apple/swift-log.git resolved at 1.2.0 Creating working copy for https://github.com/vapor/console-kit.git Working copy of https://github.com/vapor/console-kit.git resolved at 4.1.1 Creating working copy for https://github.com/tanner0101/mustache.git Working copy of https://github.com/tanner0101/mustache.git resolved at 0.1.0 Creating working copy for https://github.com/jpsim/Yams.git Working copy of https://github.com/jpsim/Yams.git resolved at 2.0.0 Creating working copy for https://github.com/apple/swift-nio.git Working copy of https://github.com/apple/swift-nio.git resolved at 2.18.0 Building for production... remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[1/14] Compiling writer.c [2/14] Compiling reader.c [3/15] Compiling parser.c [4/15] Compiling api.c [5/15] Compiling CNIOSHA1 c_nio_sha1.c [6/15] Compiling CNIOLinux shim.c [7/15] Compiling CNIOLinux ifaddrs-android.c [8/15] Compiling CNIODarwin shim.c [9/15] Compiling emitter.c [10/15] Compiling scanner.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[11/16] Compiling c-nioatomics.c [12/16] Compiling CMustache mustach.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[13/17] Compiling c-atomics.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[14/18] Compiling Logging Locks.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[15/19] Compiling NIOConcurrencyHelpers NIOAtomic.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[16/20] Compiling Mustache MustacheContext.swift [17/20] Compiling NIO AddressedEnvelope.swift /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/Channel.swift:22:30: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol ChannelCore: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/Channel.swift:105:26: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol Channel: class, ChannelOutboundInvoker { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift:20:33: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol ChannelHandler: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift:114:1: error: type 'CircularBuffer' does not conform to protocol 'MutableCollection' extension CircularBuffer: Collection, MutableCollection { ^ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift:114:1: error: unavailable subscript 'subscript(:)' was used to satisfy a requirement of protocol 'MutableCollection' extension CircularBuffer: Collection, MutableCollection { ^ Swift.MutableCollection:8:12: note: 'subscript(:)' declared here public subscript(bounds: Range<Self.Index>) -> Self.SubSequence { get set } ^ Swift.MutableCollection:6:14: note: requirement 'subscript(:)' declared here override subscript(bounds: Range<Self.Index>) -> Self.SubSequence { get set } ^ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift:719:33: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol EventLoopGroup: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift:132:1: error: type 'MarkedCircularBuffer' does not conform to protocol 'MutableCollection' extension MarkedCircularBuffer: Collection, MutableCollection { ^ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift:132:1: error: unavailable subscript 'subscript(:)' was used to satisfy a requirement of protocol 'MutableCollection' extension MarkedCircularBuffer: Collection, MutableCollection { ^ Swift.MutableCollection:8:12: note: 'subscript(:)' declared here public subscript(bounds: Range<Self.Index>) -> Self.SubSequence { get set } ^ Swift.MutableCollection:6:14: note: requirement 'subscript(:)' declared here override subscript(bounds: Range<Self.Index>) -> Self.SubSequence { get set } ^ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/console-kit/Sources/ConsoleKit/Command/CommandSignature.swift:49:38: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead internal protocol AnySignatureValue: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/console-kit/Sources/ConsoleKit/Console.swift:37:26: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead public protocol Console: class { ^~~~~ AnyObject /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:32: warning: initialization of 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') results in a dangling pointer versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: implicit argument conversion from 'yaml_version_directive_t' (aka 'yaml_version_directive_s') to 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') produces a pointer valid only for the duration of the call to 'init(_:)' versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^~~~~~~~~~~~~~~~~~~~~~ /private/tmp/vapor-20220517-98923-akz50t/toolbox-18.0.0/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: use 'withUnsafeMutablePointer' in order to explicitly convert argument to pointer valid for a defined scope versionDirective = UnsafeMutablePointer(&versionDirectiveValue) ^

    HOMEBREW_VERSION: 3.4.11-34-gc20b3ab ORIGIN: https://mirrors.ustc.edu.cn/brew.git HEAD: c20b3ab91381aca5fdfda54374fc0390cc09dd51 Last commit: 3 days ago Core tap ORIGIN: https://mirrors.ustc.edu.cn/homebrew-core.git Core tap HEAD: 1b4baeeddb26848d3b3f8ede52eb62a97d54375a Core tap last commit: 1 year, 3 months ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_BOOTSNAP: set Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby CPU: quad-core 64-bit skylake Clang: 13.1.6 build 1316 Git: 2.32.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Curl: 7.79.1 => /usr/bin/curl macOS: 12.3-x86_64 CLT: N/A Xcode: 13.3

    HOMEBREW_CC: clang HOMEBREW_CXX: clang++ MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apache2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries CMAKE_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/12 HOMEBREW_GIT: git HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk ACLOCAL_PATH: /usr/local/share/aclocal PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/bin:/bin:/usr/sbin:/sbin

    Reviewed by xiangfly11 at 2022-05-17 03:54
Meet Corvus, the first strongly declarative server-side framework.
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

Jan 29, 2022
A Swift web framework and HTTP server.
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Jun 24, 2022
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

May 30, 2022
Super lightweight web framework in Swift based on SWSGI

Ambassador Super lightweight web framework in Swift based on SWSGI Features Super lightweight Easy to use, designed for UI automatic testing API mocki

Mar 18, 2022
A Swift Multiplatform Single-threaded Non-blocking Web and Networking Framework
A Swift Multiplatform Single-threaded Non-blocking Web and Networking Framework

Serverside non-blocking IO in Swift Ask questions in our Slack channel! Lightning (formerly Edge) Node Lightning is an HTTP Server and TCP Client/Serv

Jan 29, 2022
Swift HTTP server using the pre-fork worker model

Curassow Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn. It exposes

Mar 20, 2022
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Embassy Super lightweight async HTTP server in pure Swift. Please read: Embedded web server for iOS UI testing. See also: Our lightweight web framewor

Jun 8, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

Jun 21, 2022
Evented I/O streams for Swift
Evented I/O streams for Swift

Noze.io "Das Haus das Verrückte macht." Noze.io is an attempt to carry over the Node.js ideas into pure Swift. It uses libdispatch for event-driven, n

Apr 18, 2022
💧 A server-side Swift web framework.
💧 A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

Jun 22, 2022
💧 A server-side Swift HTTP web framework.
💧 A server-side Swift HTTP web framework.

Vapor is an HTTP web framework for Swift. It provides a beautifully expressive and easy-to-use foundation for your next website, API, or cloud project

Jun 24, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

Jun 22, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

Jun 27, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

Jun 21, 2022
A Slack API Client for the Perfect Server-Side Swift Framework

PerfectSlackAPIClient is an API Client to access the Slack API from your Perfect Server Side Swift application. It is build on top of PerfectAPIClient

Dec 1, 2019
A light-weight server-side service framework written in the Swift programming language.

Smoke Framework The Smoke Framework is a light-weight server-side service framework written in Swift and using SwiftNIO for its networking layer by de

Jun 17, 2022
Left Side Menu \ Side Bar with modern interface for iOS

SideMenu A customizable, interactive, auto expanding and collapsing side menu fo

Dec 18, 2021
Meet Corvus, the first strongly declarative server-side framework.
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

Jan 29, 2022
Meet Corvus, the first strongly declarative server-side framework.
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

Jan 29, 2022
A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift
A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift

A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift. It features a great API and a battle-tested core. Supporting both MongoDB in server and embedded environments.

Jun 20, 2022