Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- exampleAnchorDataHash :: String
- exampleAnchorDataHash2 :: String
- serveFilesWhile :: (MonadBaseControl IO m, MonadTest m, MonadIO m, HasCallStack) => [([String], FilePath)] -> (Int -> m a) -> m a
- exampleAnchorDataPathTest :: String
- exampleAnchorDataPathTest2 :: String
- exampleAnchorDataPathGolden :: String
- exampleAnchorDataPathGolden2 :: String
- exampleAnchorDataIpfsHash :: String
- exampleAnchorDataIpfsHash2 :: String
- tamperBase16Hash :: String -> Maybe String
Documentation
:: (MonadBaseControl IO m, MonadTest m, MonadIO m, HasCallStack) | |
=> [([String], FilePath)] | List of pairs of a relative URL where a file will be served and the file path for the file to serve. Each element in the relative URL is a segment of the URL. |
-> (Int -> m a) | Action to run while the file is being served. It receives the port the server is listening on |
-> m a |
Takes a relative url (as a list of segments), a file path, and an action, and it serves the file in the url provided in a random free port that is passed as a parameter to the action. After the action returns, it shuts down the server. It returns the result of the action. It also ensures the server is shut down even if the action throws an exception.