I have a Haskell application using Happstack that will run fine for anywhere from 1-5 days and then suddenly become unresponsive, with the log looking something like this:
ProtocolError "error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed…
The following code:
import Control.Monad.IO.Class
import Happstack.Server
test :: ServerPart String
test = liftIO (putStrLn "Test") >> ok "Test"
main = simpleHTTP nullConf test
is failing to compile with the message:
No instance for (MonadIO…
I am using Happstack, and I am trying to upload a photograph to Facebook using the Facebook Graph API.
I can successfully post a message to Facebook. I can use url, however I am trying to do this with the source parameter.
I have a ByteString of PNG…
Whenever I use a form in my website, I need to pass an "action" attribute to it (I don't want to leave it empty because I prefer to have validating markup). Right now it looks like this:
registerPage = dir "test" $ do
nullDir
let action =…
I have a simple hello world happstack app:
module Main where
import Happstack.Server (nullConf, simpleHTTP, toResponse, ok)
main :: IO ()
main = simpleHTTP nullConf $ ok "Hello, World!"
I want it to log requests to stdout.
I found this…
I'm continuing development of my program using IxSet and I'm curious if I'm doing something wrong (or it can be optimized). Currently it consumes way too much memory than I believe it should.
Program is here:…
I'm working with blaze-html. I'm finally mostly being able to wrap my head around how to use it, but some of the monads and transformations really trip me up all the time. But here is one particular stumbling block (out of a great many, but I'll…
As it's usual when working with Happstack, I have been making my own server monad to use for the handlers, to cover my DB and Sessions, plus some error handling. I have recently discovered the happstack-clientsession-Package that is a big help and…
I'm writing web application using happstack-lite. When my ServerPart Response handler calls pure function and this function calls error, entire handler fails and happstack prints default error message.
handler :: ServerPart Response
handler = do
…
Pressing Ctrl+C (or +Z or anything else) - does not terminate a haskell application (or happstack app) in windows command line (or power shell).
Currently I have to close the window, and then open a new command line/power-shell window, navigate to…
I got an exception (used Prelude.head on an empty list) that made all the http-request after that return a 502/505 exception (and the happstack app prints "HTTP request failed with: send resource vanished (Broken pipe)" in stdout).
My question is…
I'm creating a Happstack server application, but I don't know how to end the application .
If I have:
main = do
printf "begin server"
simpleHTTP nullConf myHomepage
printf "end server"
I can run it ok, and I can kill the application (linux)…
I'm trying to get the GET and the POST from the Happstack tutorial into one handler function so it's always together, which I've kind of achieved, but it seems ugly.
login :: ServerPart Response
login = msum [
do methodM POST
user <-…
I can find plenty of documentation on using blitz and other compiletime templating libraries with happstack but I would like to know how to use html files as templates.