{"id":16017318,"url":"https://github.com/robertohuertasm/microserver","last_synced_at":"2025-05-12T03:31:48.631Z","repository":{"id":33184836,"uuid":"153987526","full_name":"robertohuertasm/microserver","owner":"robertohuertasm","description":"🔬 Simple ad-hoc server with SPA support based on Warp. ","archived":false,"fork":false,"pushed_at":"2022-04-12T13:26:19.000Z","size":131,"stargazers_count":54,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T15:13:38.865Z","etag":null,"topics":["http-server","localserver","microserver","rust","rust-crate","server","single-page-app","spa","spa-support","warp"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/microserver","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertohuertasm.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":"2018-10-21T08:24:23.000Z","updated_at":"2024-04-22T13:41:28.000Z","dependencies_parsed_at":"2022-08-07T20:15:15.911Z","dependency_job_id":null,"html_url":"https://github.com/robertohuertasm/microserver","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertohuertasm%2Fmicroserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertohuertasm%2Fmicroserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertohuertasm%2Fmicroserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertohuertasm%2Fmicroserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertohuertasm","download_url":"https://codeload.github.com/robertohuertasm/microserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253668066,"owners_count":21944971,"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":["http-server","localserver","microserver","rust","rust-crate","server","single-page-app","spa","spa-support","warp"],"created_at":"2024-10-08T16:05:02.374Z","updated_at":"2025-05-12T03:31:48.276Z","avatar_url":"https://github.com/robertohuertasm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microserver\n\n[![Actions Status](https://github.com/robertohuertasm/microserver/workflows/Release/badge.svg)](https://github.com/robertohuertasm/microserver/actions)\n[![Crates.io](https://img.shields.io/crates/v/microserver.svg)](https://crates.io/crates/microserver) [![Docker Build](https://img.shields.io/docker/cloud/build/robertohuertasm/microserver.svg)](https://hub.docker.com/repository/docker/robertohuertasm/microserver) [![Docker Pulls](https://img.shields.io/docker/pulls/robertohuertasm/microserver.svg)](https://hub.docker.com/repository/docker/robertohuertasm/microserver)\n\nSimple ad-hoc server with SPA support based on Warp! Excellent for testing React, Angular, Vue apps and the like.\n\n## Installation\n\nYou can compile it yourself:\n\n```sh\ncargo install microserver\n```\n\nor you can download the executable from [Github releases](https://github.com/robertohuertasm/microserver/releases) and add it to your path.\n\n## Usage\n\nNo argument is mandatory so the current folder will be used as default if no path is specified\n\n```sh\nmicroserver\n```\n\nyou can, of course, set the path of the folder you want to be served, by default in port `9090`.\n\n```sh\nmicroserver ./path/to/folder\n```\n\n## Need help?\n\n```sh\nmicroserver -h\n```\n\n## Changing the address\n\n```sh\n# by default microserver will use 0.0.0.0\nmicroserver -a 127.0.0.1\n```\n\n## Changing the port\n\n```sh\n# by default microserver will use 9090 port\nmicroserver -p 3000\n```\n\n## SPA support\n\nSPA support is enabled by default, meaning that if a resource is not found traffic will always be redirected to `index.html`.\n\nIf you want to opt-out of this behavior just use the `--no-spa` flag.\n\nIn the case you ever need to change the default `spa index` you can provide the `--spa-index` flag.\n\n## Docker\n\nThere are several ways to use `microserver` with a [Docker image](https://hub.docker.com/repository/docker/robertohuertasm/microserver/):\n\nWith a **Dockerfile** like the following:\n\n```dockerfile\n# please omit the version if you just want the latest\nFROM robertohuertasm/microserver:v0.1.6\n# public being the location of your app files\nCOPY public/ /app/\n```\n\nYou can then run your SPA / static site using:\n\n```bash\n$ docker build -t my-service:local .\n$ docker run -p 9090:9090 my-service:local\nMicroServer running on port 9090!\nServing /app\nSpa support: true. Root: index.html\n```\n\nAlternatively, you could mount a volume with your content:\n\n```bash\ndocker run -p 9090:9090 -v $(pwd)/public:/app robertohuertasm/microserver:v0.1.6\n```\n\nMore complex Dockerfile usage example with a multi-stage build of a React SPA:\n\n```dockerfile\nFROM node:10.18-stretch-slim as builder\nWORKDIR /app\nCOPY ./ /app\nRUN yarn\nRUN yarn build\n\nFROM robertohuertasm/microserver:v0.1.6\nCOPY --from=builder /app/public /app/\n```\n\n### If you don't want the default arguments\n\nIn this case whenever you run the `microserver` image, you'll have to be explicit about the arguments:\n\n```bash\n# don't forget to add \"/app\" as your final argument\ndocker run -p 9090:9090 -v $(pwd)/public:/app robertohuertasm/microserver:v0.1.6 \"/microserver\" \"--no-spa\" \"/app\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertohuertasm%2Fmicroserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertohuertasm%2Fmicroserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertohuertasm%2Fmicroserver/lists"}