degree9 / meta

A stack. A framework. A conversation.
MIT License
132 stars 14 forks source link

should be possible to add hooks to the entire app, not just per-path #25

Closed thedavidmeister closed 6 years ago

thedavidmeister commented 6 years ago

Not sure if this should be here or in https://github.com/degree9/featherscript but currently there only seems to be a way to add hooks per api endpoint as per meta.server/api.

Feathers itself allows for app-wide hooks, such as this example to ensure valid JWTs are always present:

(defn with-always-enforce-valid-jwt
 [app]
 (let [auth (:authenticate feathers.authentication/hooks)
       jwt-hook (auth. "jwt")]
  (.hooks app (clj->js {:before {:all [jwt-hook]}}))))
burn2delete commented 6 years ago

Moving this request to degree9/featherscript#6