Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 652 Bytes

README.md

File metadata and controls

34 lines (21 loc) · 652 Bytes

🔒

Nest example middleware to wrap your web application in HTTP auth.

NOTE: This is also the very first published Pod to use emoji as its name.

Installation

pod '🔒'

Usage

import Padlock

func application(env:Request) -> (Response) {
  return ("200 OK", [], "Hello World")
}

func isValidCredentials(username:String, password:String) -> Bool {
  return username == "kyle" && password == "nest"
}

let secureApplication = 🔒(isValidCredentials, application)

serve("127.0.0.1", 8080, secureApplication)

License

🔒 is licensed under the BSD license. See LICENSE for more information.