Noze 0.5.2 - Swift 3.0.1 GMc
We are happy to announce a minor Noze.io release: 0.5.2, codenamed ‘Basic Nozes with an End’.
The primary news is that Swift 3.0.1 GMc is out for tuxOS and seems to fix the issues we had before (SR-2656, SR-2907). Grab it on Swift.org.
Basic Auth
There is a new basic basic-auth module designed with jshttp/basic-auth in mind. Just basics, stay tuned for more. Example usage:
http.createServer { req, res in
guard let credentials = try? basicAuth.auth(req: req),
credentials.name == "John",
credentials.pass == "Doe"
else {
res.statusCode = 401
res.setHeader("WWW-Authenticate",
"Basic realm=\"Cows Heaven\"")
return res.end()
}
res.end("Welcome to the forbidden zone!")
}
Promises
By popular request you can now directly Swift throw errors in Promise
closures:
doSomething()
.then {
throw HahaNotReallyDoingItError()
}
.error { err in
print("got error \(err)")
}
Such are captured as regular Promise errors.
Changes in 0.5.2 (from 0.5.0)
- use 3.0.1 GMc on Linux which fixes SR-2907
coremodule:- support Swift
throwin Promise closures
- support Swift
streamsmodule:- fix: emit a
readableevent (w/ no data) prior emittingend
- fix: emit a
processmodule: renamedenvirontoenvto match Node- new modules:
basicAuthmodule
Documentation
In case you haven’t yet, be sure to read those dox:
To understand what Noze.io is about reading the Node Stream Handbook is recommended.
Getting the stuff
Well, as usual, head over to
GitHub
and checkout the master branch or fetch the 0.5.2 tag.
Happy Basic Nozing with an End!
hh
