/Taylor

A library for writing HTTP servers with Swift

Primary LanguageObjective-C

Taylor

Disclaimer: It is a work in progress, it may break. Use it at your own risk.

Taylor is a library which allows you to create web server applications in Swift

Status

At this moment, Taylor only supports GET and POST HTTP requests. It relies on xcodebuild to compile the binary, that's the reason of the existance of the Taylor.xcodeproj file

Demo

let taylor = Taylor(port: 5000)

taylor.get("/") {

   request, response in

    response.stringBody = "Hello World"
    response.send()

    return nil
}

taylor.startListening(forever: true)

Setup

You need to be running xCode 6 beta 2 or latest

$ git clone http://github.com/izqui/Taylor taylor-server
$ cd taylor-server
# edit main.swift
$ ./run 3000

Open localhost:3000

Documentation

Coming soon

Dependencies

Right now Taylor relies on an Objective-C library called GCDAsyncSocket. I want to do my own implementation in Swift in the future.

Inspiration