Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request.params always returns empty #67

Open
StaticActual opened this issue Mar 19, 2017 · 2 comments
Open

Request.params always returns empty #67

StaticActual opened this issue Mar 19, 2017 · 2 comments

Comments

@StaticActual
Copy link

In RequestHandler.swift, the code that sets the params property of the Request object is commented out.

@elliottminns
Copy link
Owner

I'll check it out, how are you formatting your request / endpoint?

@StaticActual
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants