Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

nestproject/Padlock

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒

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.

About

Nest middleware to lockup your web application

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.