मिलान करने के लिए कंपोजर रेगेक्स शायद मैं सिर्फ मूर्ख हूं, लेकिन मैं क्लोजर में वैकल्पिक ट्रेलिंग स्लैश के लिए एक मैच सेट नहीं कर सकता।एक पिछला स्लैश
lein repl
REPL started; server listening on localhost port 47383
user=> (use 'ring.mock.request 'clout.core)
nil
user=> (route-matches "/article/" (request :get "/article/"))
{}
user=> (route-matches "/article/?" (request :get "/article"))
nil
user=> (route-matches "/article/?" (request :get "/article/"))
nil
user=> (route-matches #"/article/?" (request :get "/article/"))
java.lang.IllegalArgumentException: No implementation of method: :route-matches of protocol: #'clout.core/Route found for class: java.util.regex.Pattern (NO_SOURCE_FILE:0)
कंपोज़र में वैकल्पिक पिछला स्लैश मिलान करने के लिए मैं किस रेगेक्स का उपयोग कर सकता हूं?
आह, मैं मिडलवेयर से बचने के लिए उम्मीद कर रहा था। हालांकि यह एकमात्र तरीका है, तो ठीक है। –