{"id":13441280,"url":"https://github.com/vercel/serve","last_synced_at":"2026-01-15T22:21:19.344Z","repository":{"id":37394585,"uuid":"57182064","full_name":"vercel/serve","owner":"vercel","description":"Static file serving and directory listing","archived":false,"fork":false,"pushed_at":"2024-10-15T17:41:51.000Z","size":1370,"stargazers_count":9587,"open_issues_count":139,"forks_count":697,"subscribers_count":107,"default_branch":"main","last_synced_at":"2025-05-06T20:19:02.273Z","etag":null,"topics":["cli","command","http","node"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/serve","language":"TypeScript","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/vercel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license.md","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":"2016-04-27T03:58:25.000Z","updated_at":"2025-05-06T15:59:11.000Z","dependencies_parsed_at":"2023-02-14T03:03:41.256Z","dependency_job_id":"5ef79a65-08e0-4ec0-afa9-615cf57f6681","html_url":"https://github.com/vercel/serve","commit_stats":{"total_commits":756,"total_committers":99,"mean_commits":7.636363636363637,"dds":0.3637566137566137,"last_synced_commit":"d06104a2de569b1bef57f567f853ab3cfd0024e4"},"previous_names":["zeit/micro-list","zeit/serve","zeit/list"],"tags_count":159,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vercel","download_url":"https://codeload.github.com/vercel/serve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252865704,"owners_count":21816307,"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":["cli","command","http","node"],"created_at":"2024-07-31T03:01:32.005Z","updated_at":"2026-01-15T22:21:19.306Z","avatar_url":"https://github.com/vercel.png","language":"TypeScript","readme":"![Serve Logo](https://raw.githubusercontent.com/vercel/serve/main/media/banner.png)\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca aria-label=\"Vercel logo\" href=\"https://vercel.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/made%20by-vercel-%23000000\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca aria-label=\"Install Size\" href=\"https://packagephobia.com/result?p=serve\"\u003e\n    \u003cimg src=\"https://packagephobia.com/badge?p=serve\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Stars\" href=\"https://github.com/vercel/serve/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/vercel/serve\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Build Status\" href=\"https://github.com/vercel/serve/actions/workflows/ci.yaml\"\u003e\n    \u003cimg src=\"https://github.com/vercel/serve/actions/workflows/ci.yaml/badge.svg\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n`serve` helps you serve a static site, single page application or just a static file (no matter if on your device or on the local network). It also provides a neat interface for listing the directory's contents:\n\n![Listing UI](https://raw.githubusercontent.com/vercel/serve/main/media/listing-ui.png)\n\n\u003e Once it's time to push your site to production, we recommend using [Vercel](https://vercel.com).\n\n## Usage\n\n\u003e `serve` v14 onwards requires Node v14 to run. Please use `serve` v13 if you cannot upgrade to Node v14.\n\nThe quickest way to get started is to just run `npx serve` in your project's directory.\n\nIf you prefer, you can also install the package globally (you'll need at least [Node LTS](https://github.com/nodejs/Release#release-schedule)):\n\n```bash\n\u003e npm install --global serve\n```\n\nOnce that's done, you can run this command inside your project's directory...\n\n```bash\n\u003e serve\n```\n\n...or specify which folder you want to serve:\n\n```bash\n\u003e serve folder-name/\n```\n\nFinally, run this command to see a list of all available options:\n\n```bash\n\u003e serve --help\n```\n\nNow you understand how the package works! :tada:\n\n## Configuration\n\nTo customize `serve`'s behavior, create a `serve.json` file in the public folder and insert any of [these properties](https://github.com/vercel/serve-handler#options).\n\n## API\n\nThe core of `serve` is [`serve-handler`](https://github.com/vercel/serve-handler), which can be used as middleware in existing HTTP servers:\n\n```js\nconst handler = require('serve-handler');\nconst http = require('http');\n\nconst server = http.createServer((request, response) =\u003e {\n  // You pass two more arguments for config and middleware\n  // More details here: https://github.com/vercel/serve-handler#options\n  return handler(request, response);\n});\n\nserver.listen(3000, () =\u003e {\n  console.log('Running at http://localhost:3000');\n});\n```\n\n\u003e You can also replace `http.createServer` with [`micro`](https://github.com/vercel/micro).\n\n## Issues and Contributing\n\nIf you want a feature to be added, or wish to report a bug, please open an issue [here](https://github.com/vercel/serve/issues/new).\n\nIf you wish to contribute to the project, please read the [contributing guide](contributing.md) first.\n\n## Credits\n\nThis project used to be called `list` and `micro-list`. But thanks to [TJ Holowaychuk](https://github.com/tj) handing us the new name, it's now called `serve` (which is much more definite).\n\n## Author\n\nLeo Lamprecht ([@leo](https://x.com/leo))\n","funding_links":[],"categories":["HarmonyOS","TypeScript","Development","Frontend","Built with Micro","JavaScript","App / CLI","cli","Uncategorized","开发辅助","\u003ca name=\"networking\"\u003e\u003c/a\u003eNetworking","Node.js","Tooling","后端开发框架及项目"],"sub_categories":["Windows Manager","HTTP Server","Local server","Utilities","Uncategorized","Server","General","后端项目_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvercel%2Fserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fserve/lists"}