The servant-rawm package

[ Tags: bsd3, library, text ] [ Propose Tags ]

Please see README.md.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2
Change log CHANGELOG.md
Dependencies base (>=4.8 && <5), bytestring (>=0.10), filepath (>=1.4), http-client (>=0.5), http-media (>=0.6), http-types (>=0.9), lens (>=4.0), resourcet (>=1.0), servant, servant-client (>=0.9), servant-docs (>=0.9), servant-rawm, servant-server (>=0.9), text, transformers, wai (>=3.2), wai-app-static (>=3.1), warp [details]
License BSD3
Copyright 2017 Dennis Gosnell
Author Dennis Gosnell
Maintainer cdep.illabout@gmail.com
Category Text
Home page https://github.com/cdepillabout/servant-rawm
Source repository head: git clone git@github.com:cdepillabout/servant-rawm.git
Uploaded Wed Oct 18 02:11:39 UTC 2017 by cdepillabout
Distributions Stackage:0.2.0.2
Executables servant-rawm-example-server, servant-rawm-example-docs, servant-rawm-example-client
Downloads 126 total (126 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-18 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Flags

NameDescriptionDefaultType
buildexample

Build a small example program

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for servant-rawm-0.2.0.2

[back to package description]

Servant.RawM

Build Status Hackage Stackage LTS Stackage Nightly BSD3 license

servant-rawm provides a way to embed a WAI Application in a Servant handler. It is more convenient and powerful than the Raw type provided by servant.

See the Haddocks on Hackage for servant-rawm for an explanation of how to use the RawM type.

Example

There is code for an example server, client, and documentation located in example/. The following section describes how to run the example executables.

Building

The example executables can be built with the following command:

$ stack build --flag servant-rawm:buildexample

Server

After building, the server can be run with the following command:

$ stack exec -- servant-rawm-example-server

This runs a server on port 8201 serving files in example/files/.

It can be accessed from curl like the following:

$ curl http://localhost:8201/serve-directory/foo.txt
This is an example text file.

Client

After building, the client can be run like the following:

$ stack exec -- servant-rawm-example-client
Successfully got file ./example/files/foo.txt:

This is an example text file.

Documentation

After building, the documentation can be generated like the following. This is documentation for the API defined in example/Api.hs:

$ stack exec -- servant-rawm-example-docs
...