Skip to content

Commit fe55f55

Browse files
committed
docs:fix
1 parent 73036b2 commit fe55f55

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ end)
165165

166166
-- 11. Check if events are executing properly
167167
router:get("/add", function(ctx)
168-
cnt = cnt + 1
169-
return cnt
168+
router:emit('add')
169+
return ctx.cnt
170170
end)
171171

172172
router:get("/events", function(ctx)

Diff for: app.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ end)
119119

120120
-- 11. Check if events are executing properly
121121
router:get("/add", function(ctx)
122-
cnt = cnt + 1
123-
return cnt
122+
router:emit('add')
123+
return ctx.cnt
124124
end)
125125

126126
router:get("/events", function(ctx)

Diff for: test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def run_tests():
188188
test_endpoint("/func", expected_response="function called")
189189

190190
# 11. Test events
191-
test_endpoint("/add", expected_response=1)
191+
test_endpoint("/add", expected_response=0)
192192
test_endpoint("/events", expected_response=1)
193193

194194
# 12. Test ctx.response.body

0 commit comments

Comments
 (0)