0

I'm using Pux.Router and can't get a path such as auth/facebook to work. auth works and facebook works but not together. For example FacebookAuth <$> (lit "facebook" *> param "access_token") <*> (param "expires_in") <* end works but not FacebookAuth <$> (lit "auth/facebook" *> param "access_token") <*> (param "expires_in") <* end. It will compile but you cannot navigate to auth/facebook.

torchhound
  • 510
  • 6
  • 15

1 Answers1

0

I haven't used Pux.Router, but my thought is that you can only use single path components inside lit, so having nested components in a single string won't work.

You might try separating the paths like this...

FacebookAuth <$>
  (lit "auth" *> lit "facebook" *> param "access_token") <*>
  (param "expires_in") <* end

Which will apply the access_token and expires_in parameters to the FacebookAuth constructor. So then it would match /auth/facebook/:access_token/:expires_in

Albtzrly
  • 924
  • 1
  • 6
  • 15
  • `FacebookAuth <$> (lit "auth" *> lit "facebook" *> param "access_token") <*> (param "expires_in") <* end` returns error `Could not match type Unit with type String`. – torchhound Aug 22 '17 at 03:02