@@ -124,7 +124,7 @@ jsaddleOr opts entryPoint otherApp = do
124124
125125
126126jsaddleApp :: Application
127−jsaddleApp = jsaddleAppWithJs $ jsaddleJs Nothing False
127+jsaddleApp = jsaddleAppWithJs $ jsaddleJs False
128128
129129jsaddleAppWithJs :: ByteString -> Application
130130jsaddleAppWithJs js req sendResponse =
@@ -138,7 +138,7 @@ jsaddleWithAppOr opts entryPoint otherApp = jsaddleOr opts entryPoint $ \req sen
138138 (jsaddleAppPartial req sendResponse))
139139
140140jsaddleAppPartial :: Request -> (Response -> IO ResponseReceived) -> Maybe (IO ResponseReceived)
141−jsaddleAppPartial = jsaddleAppPartialWithJs $ jsaddleJs Nothing False
141+jsaddleAppPartial = jsaddleAppPartialWithJs $ jsaddleJs False
142142
143143indexResponse :: Response
144144indexResponse = W.responseLBS H.status200 [("Content-Type", "text/html")] indexHtml
@@ -149,10 +149,13 @@ jsaddleAppPartialWithJs js req sendResponse = case (W.requestMethod req, W.pathI
149149 ("GET", ["jsaddle.js"]) -> Just $ sendResponse $ W.responseLBS H.status200 [("Content-Type", "application/javascript")] js
150150 _ -> Nothing
151151
152+jsaddleJs :: Bool -> ByteString
153+jsaddleJs = jsaddleJs' Nothing
154+
152155-- Use this to generate this string for embedding
153156-- sed -e 's|\\|\\\\|g' -e 's|^| \\|' -e 's|$|\\n\\|' -e 's|"|\\"|g' data/jsaddle.js | pbcopy
154−jsaddleJs :: Maybe ByteString -> Bool -> ByteString
155−jsaddleJs jsaddleUri refreshOnLoad = "\
157+jsaddleJs' :: Maybe ByteString -> Bool -> ByteString
158+jsaddleJs' jsaddleUri refreshOnLoad = "\
156159 \if(typeof global !== \"undefined\") {\n\
157160 \ global.window = global;\n\
158161 \ global.WebSocket = require('ws');\n\
@@ -216,7 +219,7 @@ debug :: Int -> JSM () -> IO ()
216219debug port f = do
217220 debugWrapper $ \withRefresh registerContext ->
218221 runSettings (setPort port (setTimeout 3600 defaultSettings)) =<<
219− jsaddleOr defaultConnectionOptions (registerContext >> f >> syncPoint) (withRefresh $ jsaddleAppWithJs $ jsaddleJs Nothing True)
222+ jsaddleOr defaultConnectionOptions (registerContext >> f >> syncPoint) (withRefresh $ jsaddleAppWithJs $ jsaddleJs True)
220223 putStrLn $ "<a href=\"http://localhost:" <> show port <> "\">run</a>"
221224
222225refreshMiddleware :: ((Response -> IO ResponseReceived) -> IO ResponseReceived) -> Middleware