srv: A simple web server for local usage.

[ apache, program, web ] [ Propose Tags ]

Please see the README on GitHub at

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS]
Dependencies async (<2.3), base (>=4.7 && <5), bytestring (<0.12), containers (<0.7), directory (<1.4), raw-strings-qq (<1.2), wai (<3.3), wai-app-static (<3.2), warp (<3.4), warp-tls (<3.4), yaml (<0.12) [details]
License Apache-2.0
Copyright 2022 Thomas Mahler
Author Thomas Mahler
Category Web
Home page
Bug tracker
Source repo head: git clone
Uploaded by thma at 2022-12-18T10:39:32Z
Executables srv
Downloads 71 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2022-12-18 [all 1 reports]

Readme for srv-

[back to package description]


srv is a tiny web server for local deployments


build from source

$ git clone
$ cd srv
$ stack install 

-- or if you don't have stack installed

$ cabal install


$ srv

starting up srv...
srv.yaml not found, generating file with default config
Starting HTTP server on port 8080
Starting HTTPS server on port 8443

During the initial run, srv will create a config file "srv.yaml" in the current directory.

You can edit this file to change the port, the directory to serve, and also select whether host HTTP or HTTPS or both.

If HTTPS is selected, you can also provide a certificate and key file. If you don't provide both files, srv will use a predefined self-signed certificate which is meant for local demo use only. (using this demo certificate will result in a warning in your browser and some browsers will even refuse to connect.)


Here is a sample configuration file:

documentRoot: .
- - HTTP
  - 8080
  - 8443
pathToCert: certificate.pem
pathToKey: key.pem

How to generate your own certificate

openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out certificate.csr
openssl x509 -req -in certificate.csr -signkey key.pem -out certificate.pem