nedpals / vex

Easy-to-use, modular web framework built for V
https://nedpals.github.io/vex
MIT License
339 stars 28 forks source link

Get error of middleware: Unknown method. #22

Closed changrui closed 3 years ago

changrui commented 3 years ago
8 | struct Person {

middleware_example.v:24:6: error: unknown method: nedpals.vex.router.Router.get. 6 possibilities: group, inject, receive, respond_error, route, use. 22 | mut app := router.new() 23 | app.use(do_stuff, print_req_info) 24 | app.get('/', fn (req ctx.Req, mut res ctx.Resp) { | ~~~~~~~~~ 25 | res.send_json(Person{ 26 | name: req.query['name'] middleware_example.v:30:6: error: unknown method: nedpals.vex.router.Router.get. 6 possibilities: group, inject, receive, respond_error, route, use. 28 | }, 200) 29 | }) 30 | app.get('/hello', fn (req ctx.Req, mut res ctx.Resp) { | ~~~~~~~~~~ 31 | res.send('Hello World!', 200) 32 | })

nedpals commented 3 years ago

Closed. I fixed the middleware example. Thanks for reporting :smile: