Swiftpack.co - viralplatipuss/HTTPServerIO as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by viralplatipuss.
viralplatipuss/HTTPServerIO 0.0.3
HTTP Server IO Handler for use with the SimpleFunctional library
⭐️ 0
🕓 3 years ago
.package(url: "https://github.com/viralplatipuss/HTTPServerIO.git", from: "0.0.3")

HTTPServerIO

HTTP Server IO type and handler for use with the SimpleFunctional library.

Provides a very basic HTTP web server as an IO handler. Will be extended as needed to handle more complex requests.

This is powered using Vapor's HTTP library, which means it is a multi-platform IO handler. Linux, Mac, iOS

public struct HTTPServerIO: IO {
    
    public struct HTTPHeaders {
        public enum StandardHeader {
            case authorization
        }
        
        public let stringValuesForStandardHeader: [StandardHeader: [String]]
    }
    
    public enum Input {
        case serverStarted
        case incomingRequest(id: UInt, urlString: String, httpHeaders: HTTPHeaders)
    }
    
    public enum Output {
        case startServer(hostname: String, port: UInt)
        case respondToRequest(id: UInt, httpStatusCode: UInt, bodyBytes: [UInt8]?)
    }
}


GitHub

link
Stars: 0
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics