Skip to content

Commit a947ffb

Browse files
authored
Merge pull request #74 from JuliaWeb/tan/misc
update README (fix #71) [ci skip]
2 parents 4257a38 + 3613d49 commit a947ffb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ end
3939
testfn2(arg1, arg2; narg1="1", narg2="2") = testfn1(arg1, arg2; narg1=narg1, narg2=narg2)
4040

4141
# Expose testfn1 and testfn2 via a ZMQ listener
42-
process([(testfn1, true), (testfn2, false)], "tcp://127.0.0.1:9999"; bind=true)
42+
process(
43+
JuliaWebAPI.create_responder([
44+
(testfn1, true),
45+
(testfn2, false)
46+
], "tcp://127.0.0.1:9999", true, "")
47+
)
4348
```
4449

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

6974
````
70-
function auth_preproc(req::Request, res::Response)
75+
function auth_preproc(req::HTTP.Request)
7176
if !validate(req)
72-
res.status = 401
73-
return false
77+
return HTTP.Response(401)
7478
end
75-
return true
79+
return nothing
7680
end
7781
run_http(apiclnt, 8888, auth_preproc)
7882
````

0 commit comments

Comments
 (0)