Re: Routes for both WWW and API

2014-06-28 Thread James Reeves
Middleware can be added directly to your routes. e.g.

(routes
 (wrap-foo foo-routes)
 (wrap-bar bar-routes))

Routes are just Ring handlers that return nil to indicate they haven't
matched the URI.

- James


On 28 June 2014 19:25, Jonathon McKitrick  wrote:

> I'd like my app to server the WWW content as well as the API for the
> client to call.  How can I used different middleware with each?
>
> Here's what I have so far:
>
> (def app
>   (-> (handler/site
>(routes
> www-routes
> api-routes
> ;; Should this replace the line below?
> ;;(wrap-file "public" )
> (route/resources "/")
> (route/not-found "Not Found")))
>   ;; Can we just wrap API handlers?
>   (wrap-restful-response)))
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Routes for both WWW and API

2014-06-28 Thread Jonathon McKitrick
I'd like my app to server the WWW content as well as the API for the client 
to call.  How can I used different middleware with each?

Here's what I have so far:

(def app
  (-> (handler/site
   (routes 
www-routes
api-routes
;; Should this replace the line below?
;;(wrap-file "public" )
(route/resources "/")
(route/not-found "Not Found")))
  ;; Can we just wrap API handlers?
  (wrap-restful-response)))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Quil 2.1.0 released

2014-06-28 Thread J David Eisenberg


On Friday, June 13, 2014 12:48:34 PM UTC-7, Nikita Beloglazov wrote:
>
> Friday the 13th and a full moon is ideal time for a release!
>
> Happy to announce release of Quil 2.1.0. It is available on clojars: 
> https://clojars.org/quil
>
> Here is the list of changes:
>
>- Middleware  support.
>- Functional mode 
> 
>support.
>- Updated to Processing 2.2.1.
>- New methods: resize  and 
>state-atom . 
>- :no-safe-draw feature renamed to :no-safe-fns.
>- Fixed NPE when exiting :p2d sketch using "esc" key. #110 
>.
>- Wrap all user-provided function to safe wrappers. #106 
>. 
>
> Most interesting changes are middleware 
>  and functional mode 
> . Take 
> a look at them.
>

Haven't time to experiment with it right now, but functional mode looks 
*wonderful*. 

> Thanks Maksim Karandashov for contributing and help with release testing.
>
> Future plans:
>
>- Quil on ClojureScript - GSoC project which Maksim is working on. 
>- More cool middleware. There some ideas on middleware wiki page, feel 
>free to grab and implement them. Would be happy to get more 
>ideas/implementations.
>- Work on http://quil.info to make it more than simple API site. 
>
> Your feedback is welcome. 
>
> Happy hacking!
>
>
> Nikita Beloglazov
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] friendui 0.3.0

2014-06-28 Thread Sven Richter
Hi Frozen,

Currently there is only the option to send mail via sendmail or dont send a 
mail at all. If you turn it off you can use your application to send an 
activation email, as the activation id is provided in create-user method of 
the storage protocol.
Of course you can add issues or pull requests to friend-ui. I will work on 
them as time comes at my hand.

Best Regards,
Sven

Am Freitag, 27. Juni 2014 22:11:43 UTC+2 schrieb Frozenlock:
>
> Looks nice!
>
> I'll try to think to use it in my next project.
>
>
> One little problem I can see is the sendmail requirement.
> Isn't there a way to add a remote SMTP? (Like with the postal library?)
>
> On Wednesday, June 25, 2014 4:05:38 PM UTC-4, Sven Richter wrote:
>>
>> Hi,
>>
>> I just wanted to announce friendui 0.3.0. 
>> https://github.com/sveri/friend-ui/
>> I did a major rework and removed the dependency to datomic. Instead one 
>> can implement a storage protocal with whatever storage one prefers.
>> Feedback is welcome.
>>
>> Best Regards,
>> Sven
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.