blackfire
blackfire copied to clipboard
Request.params always returns empty
In RequestHandler.swift, the code that sets the params property of the Request object is commented out.
I'll check it out, how are you formatting your request / endpoint?
let app = Flame()
app.use("/api", AppRouter.getRouter())
enum AppRouter {
public static func getRouter() -> Router {
let router = Router()
router.post("/documents/:id") { req, res in
print(req.params)
res.send(json: ["No": "Params"])
}
return router
}
}
Request is just a post to that route with a random id. No matter what the id is, req.params
is empty.