homepage: https://github.com/dmjio/servant-wasm
changelog-type: markdown
hash: 670a41ae1c49acc3a2a6bf0b2b42081d48f2d1b1f5db4f8b983712362edc534f
test-bench-deps: {}
maintainer: djohnson.m@gmail.com
synopsis: Servant support for delivering WebAssembly
changelog: |
  # Revision history for servant-wasm

  ## 0.1.0.0 -- YYYY-mm-dd

  * First version. Released on an unsuspecting world.
basic-deps:
  bytestring: -any
  base: <5
  servant: -any
all-versions:
- 0.1.0.0
author: David Johnson
latest: 0.1.0.0
description-type: markdown
description: |
  # servant-wasm
  Content-Type support for delivering WASM with [servant](https://github.com/haskell-servant/servant)

  ### Usage

  ```haskell
  {-# LANGUAGE PolyKinds #-}
  {-# LANGUAGE DataKinds #-}
  {-# LANGUAGE TypeOperators #-}
  {-# LANGUAGE TypeApplications #-}
  {-# LANGUAGE OverloadedStrings #-}
  module Main where

  import           Control.Monad.IO.Class     (liftIO)
  import qualified Data.ByteString            as B
  import           Data.Proxy
  import           Network.Wai.Handler.Warp
  import           Servant.Server
  import           Servant.Server.StaticFiles
  import           Servant.WASM

  type API = "wasm" :> Get '[WASM] ByteString :<|> Raw

  main :: IO ()
  main = do
    putStrLn "Running on 3000..."
    run 3000 (serve (Proxy @ API) handlers)

  handlers = wasmHandler :<|> serveDirectoryFileServer "."

  wasmHandler :: Handler ByteString
  wasmHandler = liftIO (B.readFile "hello.wasm")
  ```
license-name: BSD-3-Clause

Update from Hackage at 2020-05-16T21:58:19Z
Update from Hackage at 2020-05-16T21:58:19Z
