izqui / Taylor

A lightweight library for writing HTTP web servers with Swift
MIT License
926 stars 79 forks source link

Make HTTPStatus an enum and implement custom error pages #29

Closed Danappelxx closed 8 years ago

Danappelxx commented 8 years ago

Sample code:

server.errorPage(.NotFound) { req, res in
    res.bodyString = "Sorry, but the page you're looking for doesn't seem to exist!"
    return .Send(req, res)
}
Danappelxx commented 8 years ago

The changes are fairly trivial so I'm just going to merge this. If anyone has any concerns - feel free to reopen this!