{"id":16906527,"url":"https://github.com/rsms/serve-http","last_synced_at":"2025-06-21T10:32:27.005Z","repository":{"id":36438296,"uuid":"224490850","full_name":"rsms/serve-http","owner":"rsms","description":"Simple, safe single-file local web server","archived":false,"fork":false,"pushed_at":"2024-06-18T18:41:21.000Z","size":584,"stargazers_count":48,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T05:48:10.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/rsms.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-27T18:14:08.000Z","updated_at":"2024-12-13T04:20:53.000Z","dependencies_parsed_at":"2024-10-26T21:18:08.731Z","dependency_job_id":"6d18792c-371f-47f6-bbd3-a6a694e2729c","html_url":"https://github.com/rsms/serve-http","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"890e3e3aabf717f48e23198f64b1836891664cc9"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rsms/serve-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fserve-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fserve-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fserve-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fserve-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsms","download_url":"https://codeload.github.com/rsms/serve-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fserve-http/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260793475,"owners_count":23064042,"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-13T18:43:02.254Z","updated_at":"2025-06-21T10:32:21.995Z","avatar_url":"https://github.com/rsms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serve-http\n\nSimple single-file local web server\n\n`npm i -g serve-http`\n\n- Single file without dependencies — copy it into your project.\n- Livereload — HTML pages reload automatically in web browsers as they change.\n- Safety feature: Only serves local connections unless given explicit command-line argument.\n- Safety feature: Refuses to serve directories outside home directory to remote connections.\n\nInstall through [`npm i -g serve-http`](https://www.npmjs.com/package/serve-http) or by copying\n[`serve-http`](https://raw.githubusercontent.com/rsms/serve-http/master/serve-http)\ninto your project (no dependencies; entire thing contained in a single small file.)\n\n```\n$ ./serve-http -help\nUsage: serve-http [options] [\u003cdir\u003e]\n\n\u003cdir\u003e\n  Directory to serve files from. Defaults to the current directory.\n\nOptions:\n  -p, -port \u003cport\u003e  Listen on specific \u003cport\u003e\n  -host \u003chost\u003e      Bind to \u003chost\u003e instead of \"localhost\"\n  -public           Accept connections from anywhere (same as -host \"\")\n  -q, -quiet        Don't log requests\n  -no-livereload    Disable livereload\n  -no-dirlist       Disable directory listing\n  -dirlist-hidden   Show files beginning with \".\" in directory listings\n  -h, -help         Show help and exit\n  -version          Print version to stdout and exit\n\nExamples:\n\n  serve-http\n    Serve current directory on some available port\n\n  serve-http -p 8080 docs\n    Serve directory ./docs locally on port 8080\n\n  serve-http -public -no-dirlist\n    Serve current directory publicly on some available port,\n    without directory listing.\n\n```\n\n## JavaScript API\n\nserve-http can also be used as a library:\n\n```js\nconst { createServer } = require(\"serve-http\")\nconst server = createServer({ pubdir: __dirname, port: 1234 })\n// `server` is a standard nodejs http server instance.\n```\n\nSee TypeScript type definitions for documentation of the API:\n[`serve-http.d.ts`](serve-http.d.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsms%2Fserve-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsms%2Fserve-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsms%2Fserve-http/lists"}