Skip to content

Commit

Permalink
Merge pull request #74 from JuliaWeb/tan/misc
Browse files Browse the repository at this point in the history
update README (fix #71) [ci skip]
  • Loading branch information
tanmaykm authored Nov 10, 2018
2 parents 4257a38 + 3613d49 commit a947ffb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ end
testfn2(arg1, arg2; narg1="1", narg2="2") = testfn1(arg1, arg2; narg1=narg1, narg2=narg2)

# Expose testfn1 and testfn2 via a ZMQ listener
process([(testfn1, true), (testfn2, false)], "tcp://127.0.0.1:9999"; bind=true)
process(
JuliaWebAPI.create_responder([
(testfn1, true),
(testfn2, false)
], "tcp://127.0.0.1:9999", true, "")
)
```

Start the server process in the background. This process will run the ZMQ listener.
Expand Down Expand Up @@ -67,12 +72,11 @@ This will return the following JSON response to your browser, which is the resul
Example of an authentication filter implemented using a pre-processor:

````
function auth_preproc(req::Request, res::Response)
function auth_preproc(req::HTTP.Request)
if !validate(req)
res.status = 401
return false
return HTTP.Response(401)
end
return true
return nothing
end
run_http(apiclnt, 8888, auth_preproc)
````

0 comments on commit a947ffb

Please sign in to comment.