Comments (1)
this is how resourcesmaybe should be written:
(defrecord ResourcesMaybe [options]
bidi/Matched
(resolve-handler [this m]
(let [path (url-decode (:remainder m))]
(when (not-empty path)
(when-let [res (io/resource (str (:prefix options) path))]
(assoc (dissoc m :remainder)
:handler (->
(fn [req] (resource-response (str (:prefix options) path)))
(wrap-content-type options)
(wrap-not-modified) ; awb99 hack
))))))
(unresolve-handler [this m]
(when (= this (:handler m)) "")))
from bidi.
Related Issues (20)
- Bidi brings older version of `ring-core` into projects; should it be :scope "provided"? HOT 1
- `just-path` removes # HOT 9
- Ring async handler support HOT 1
- X-Forwarded-Host is used over Host, can lead to security issues HOT 4
- Coercion around a route causes custom match extension records to be lost (affects vhosts) HOT 1
- Add Ataraxy in the comparison chart in the README.md
- compilation warnings (from a shadow-cljs project depending on [bidi "2.1.4"]) HOT 3
- Document uri-info better
- bidi.ring - alternates don't work
- Example with alpeh
- CLJS implementation does not parse longs properly
- Feature Request: Adding headers in a 307 redirect.
- Implementation of protocols for MultiFn HOT 2
- How to route to a pdf file
- Non-ASCII characters as path parameters
- Reflection warning on java.net.URLDecoder/decode
- filesmaybe missing
- Coercion on route path and query paramaters HOT 1
- Don't remove :handler from match-context
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 bidi.