Re: Happstack, Yesod

Skip to first unread message

Corentin Dupont

May 10, 2016, 2:21:53 PM5/10/16
to Julian Arni, haskell-servant,, Jeremy Shaw

OK... I also use happstack-authenticate for authentication of my website. Can it be used with servant?
I'm not sure if happstack-authenticate can use the auth token in the HTTP header.

In general, how and where do you retrieve an auth token? Should I retrieve from happstack-authenticate?
I found this:
is this the token I should put in the header when making an API request?

On Tue, May 10, 2016 at 3:48 PM, Julian Arni <> wrote:
Nope... the initial work was done by Jeremy Shaw, but someone would have to take over the task of merging it (which involves refactoring some of the common logic, and which relates to work that Greg Hale did with servant-snap). I don't know if anyone is working on that though.

On Tue, May 10, 2016 at 3:29 PM, Corentin Dupont <> wrote:
Do you know when it will be released?

On Tue, May 10, 2016 at 3:18 PM, Julian Arni <> wrote:
With Yesod it's fairly easy - you can just use the `Raw` combinator

type MyAPI = ServantAPI :<|> "yesod" :> Raw

myServer :: Server MyAPI
myServer = servantServer :<|> toWaiApp ...

With Happstack, servant-happstack is an option (though then you would not be able to use the above method for Yesod, I believe).

Alternatively, you can just proxy the requests to the other frameworks, either by (a) having a proxy server that dispatches to either servant or the other framework based on route or headers or whatever it is, or (b) having one of the servant routes use a proxy (e.g., http-proxy [0]), and again use Raw. (a) is a pretty common technique generally.


On Tue, May 10, 2016 at 2:47 PM, Corentin Dupont <> wrote:
Hi guys,
can I use servant with Happstack?
My app is currently built with Happstack, so it would be nice to handle the REST API also with it.
It seems there is only an alpha release now, right?
And what about Yesod? Is it supported?

You received this message because you are subscribed to the Google Groups "haskell-servant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Reply all
Reply to author
0 new messages