Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Info/Question] PureScript 0.12 #75

Closed
giuliohome opened this issue May 8, 2019 · 6 comments
Closed

[Info/Question] PureScript 0.12 #75

giuliohome opened this issue May 8, 2019 · 6 comments

Comments

@giuliohome
Copy link

Just to share the changes I had to do to run the example in the Getting Started

Notice that I had to install the following (which was not specified)

bower i purescript-indexed-monad

and my final code for the Main.purs is

module Main where

import Prelude
import Control.Monad.Indexed ((:*>))
import Effect (Effect)
import Effect.Console (log)
import Hyper.Node.Server (defaultOptionsWithLogging, runServer)
import Hyper.Response (closeHeaders, respond, writeStatus)
import Hyper.Status (statusOK)
import Node.HTTP 

main :: Effect Unit
main =
  let app = writeStatus statusOK
            :*> closeHeaders
            :*> respond "Hello, Hyper!"
  in runServer defaultOptionsWithLogging {} app

It seems that the server is running fine on my localhost port 300 and I'm getting an "Hello, Hyper!" from there...

@giuliohome
Copy link
Author

giuliohome commented May 8, 2019

in the meantime I've found the updated doc here

this issue has originated from the fact that the "latest" version shown from https://hyper.wickstrom.tech is misleading

@nsaunders
Copy link
Collaborator

Sorry about that. @owickstrom has a lot of other projects and priorities but will upload the docs when time permits. I have also opened #71 to hopefully enable other contributors to keep the docs up-to-date, but I have yet to do any significant work on it.

@giuliohome
Copy link
Author

giuliohome commented May 8, 2019

Thank you very much for the prompt response and for the great work.

Excuse me for the off topic, but: is there an example or is there anyone using (twitter) oauth (server side) on purescript (in this case I mean on Hyper)? My initial idea for learning Hyper was indeed porting a Twitter app of mine from my Flutter/Android mobile to Hyper (to run it on my windows laptop). I was wondering if I had to use an Haskell web server, but I thought choosing Purescript/Hyper would have been simpler and lighter... Thanks again for all the useful information.

@nsaunders
Copy link
Collaborator

It sounds like a good use case for something like Hyper, but I think you'd have to create your own middleware for OAuth. If you're feeling ambitious, here are some links that might help:

@giuliohome
Copy link
Author

Ok, understood, thank you very much for the prompt feedback and the useful links. Much appreciated. Best regards

@owickstrom
Copy link
Collaborator

Docs for 0.9.0 are uploaded now. I'm sending a PR with some docs script fixes soon, but we're moving to RTD anyway so not super important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants