{"id":17997358,"url":"https://github.com/thma/srv","last_synced_at":"2025-03-26T04:31:16.943Z","repository":{"id":37246055,"uuid":"505582280","full_name":"thma/srv","owner":"thma","description":"srv is a tiny web server for local deployments","archived":false,"fork":false,"pushed_at":"2022-12-27T11:15:15.000Z","size":28,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T22:40:29.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-20T20:04:49.000Z","updated_at":"2024-01-31T16:38:04.000Z","dependencies_parsed_at":"2023-01-31T03:15:16.122Z","dependency_job_id":null,"html_url":"https://github.com/thma/srv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thma%2Fsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thma%2Fsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thma%2Fsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thma%2Fsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thma","download_url":"https://codeload.github.com/thma/srv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245589255,"owners_count":20640252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T21:18:08.310Z","updated_at":"2025-03-26T04:31:16.559Z","avatar_url":"https://github.com/thma.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srv\n`srv` is a tiny web server for local deployments. \nI found it useful for development and testing of static websites and blogs\n\n## Installation\n\n```bash\n$ cabal install srv\n```\n\n## build from source\n\n```bash\n\n$ git clone https://github.com/thma/srv.git\n$ cd srv\n$ stack install \n\n-- or if you don't have stack installed\n\n$ cabal install\n```\n\n## Usage\n\n```bash\n$ cd /path/to/your/documentRoot\n$ srv\n\nstarting up srv...\nsrv.yaml not found, generating file with default config\nStarting HTTP server on port 8080\nStarting HTTPS server on port 8443\n```\n\nDuring the initial run, `srv` will create a config file `srv.yaml`\nin the current directory. \n\nYou can edit this file to change the port, the directory to serve, \nand also select whether to handle HTTP or HTTPS or both.\n\nIf HTTPS is selected, you can also provide a certificate and key file.\nIf you don't provide both files, srv will use a predefined\nself-signed certificate which is meant for local demo use only.\n(using this demo certificate will result in a warning in your browser \nand some browsers will even refuse to connect.)\n\nBy default, `srv` will serve the current directory. You can change this by\nediting the entry `documentRoot` in the `srv.yaml` file.\n\nBy default `srv` will also open a browser window pointing to the directory configured in `documentRoot`. This behaviour can be changed by setting the entry `autoOpenBrowser` to `false`.\n\n## Configuration\n\nHere is a sample configuration file:\n\n```yaml\nautoOpenBrowser: true\ndocumentRoot: .\nhandlers:\n- - HTTP\n  - 8080\n- - HTTPS\n  - 8443\npathToCert: /path/to/certificate.pem\npathToKey: /path/to/key.pem\n```\n\n## How to generate your own certificate\n\n```bash\nopenssl genrsa -out key.pem 2048\nopenssl req -new -key key.pem -out certificate.csr\nopenssl x509 -req -in certificate.csr -signkey key.pem -out certificate.pem\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthma%2Fsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthma%2Fsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthma%2Fsrv/lists"}