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

Explicit request object in defpage #131

Open
eslick opened this issue Oct 11, 2012 · 0 comments
Open

Explicit request object in defpage #131

eslick opened this issue Oct 11, 2012 · 0 comments

Comments

@eslick
Copy link

eslick commented Oct 11, 2012

Noir is a fantastic packaging of functionality, but several of us prefer to program in a more functional, less 'bindings' way. Middleware wrappers allow us to add system-level state to ring requests, but a dynamic binding is the only way to extract and use that request object. My own solution has been to write a wrapper which destructures the request object and other state added by middleware which gets annoying.

This is a long way of asking whether we can add a special parameter to get the full request object in the defpage destructuring argument, or add a request variable to the defpage macro call so we can refer to it explicitly?

(defpage [:post "/api/foo/bar"] {:keys [userid param2 +request+]} & body)

or optional defpage form

(defpage [:post "/api/foo/bar'] request {:keys [userid param2]} & body)

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

1 participant