Discussion:
Happstack, Yesod
Corentin Dupont
2016-05-10 18:21:53 UTC
Permalink
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:
https://hackage.haskell.org/package/happstack-authenticate-2.3.4/docs/src/Happstack-Authenticate-Core.html#getToken
is this the token I should put in the header when making an API request?
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 <
Thanks.
https://github.com/haskell-servant/servant/tree/servercommon/servant-happstack
Do you know when it will be released?
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.
[0] https://hackage.haskell.org/package/http-proxy
On Tue, May 10, 2016 at 2:47 PM, Corentin Dupont <
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?
Thanks,
Corentin
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/haskell-servant/CAEyhvmo5wub_YCw48q2ijEXHpPguinLgD-W%3D83O-pyqpnY6yag%40mail.gmail.com
<https://groups.google.com/d/msgid/haskell-servant/CAEyhvmo5wub_YCw48q2ijEXHpPguinLgD-W%3D83O-pyqpnY6yag%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "HAppS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to happs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/happs.
For more options, visit https://groups.google.com/d/optout.
Loading...