Comments (6)
Clout doesn't match the query string, I'm afraid. You can just match "/api/verify" and then check the token exists in Compojure.
from clout.
mmmhh, thanks @weavejester, is there an example out in the wild for that?
from clout.
Sure. You could write it:
(GET "/api/verify" [token]
(when token ...))
Because if token
is nil
, the route returns nil
and therefore the next route is tried. Alternatively:
(GET "/api/verify" [token :<< identity]
...)
Coercions fail the route if they are nil
, so by using the identity function as the coercion, we achieve the same effect as using when
.
from clout.
yep, thanks but i rather meant an example where you are using clout for route matching and then compojure for query parameter parsing both.
from clout.
That is an example of using Clout for route matching. Compojure uses Clout.
from clout.
oh i see. learned. many thanks!
from clout.
Related Issues (15)
- route-matches Doesn't Match from Servlet Root HOT 2
- Path segment URL decoding causes problems HOT 1
- Routes Throwing 500 in API, fixed after cycling HOT 3
- Missing optional parameters support HOT 3
- Support encoded path components HOT 1
- clout incorrectly excludes ',' from allowed path characters HOT 3
- Upgrade to instaparse 1.3.6 for Clojure 1.7.0 compatibility
- Captured groups in patterns clobber following path parameters HOT 2
- IllegalArgumentException with `:aot :all` and `lein trampoline run` HOT 5
- Old instaparse dependency HOT 4
- Routes with negative lookahead regex always return nil HOT 3
- [SOLVED] java.lang.IllegalArgumentException: No implementation of method: :route-matches of protocol: #'clout.core/Route found for class: clout.core.CompiledRoute HOT 16
- Clojure 1.3? HOT 3
- + sign in uri path is getting converted to space
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clout.