{"id":13799233,"url":"https://github.com/koa-modules/serve-static","last_synced_at":"2025-05-16T16:31:16.995Z","repository":{"id":29780018,"uuid":"33324070","full_name":"koa-modules/serve-static","owner":"koa-modules","description":"Serve static files, based on Express's serve-static.","archived":false,"fork":false,"pushed_at":"2015-12-27T08:50:21.000Z","size":13,"stargazers_count":16,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T03:23:18.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/koa-modules.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2015-04-02T18:09:02.000Z","updated_at":"2021-06-07T02:46:30.000Z","dependencies_parsed_at":"2022-09-18T19:28:40.639Z","dependency_job_id":null,"html_url":"https://github.com/koa-modules/serve-static","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koa-modules%2Fserve-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koa-modules%2Fserve-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koa-modules%2Fserve-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koa-modules%2Fserve-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koa-modules","download_url":"https://codeload.github.com/koa-modules/serve-static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224876908,"owners_count":17384702,"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-08-04T00:01:00.174Z","updated_at":"2024-11-18T13:32:05.574Z","avatar_url":"https://github.com/koa-modules.png","language":"JavaScript","readme":"# koa-serve-static\n\n\u003e Serve static files for koa.  \n\u003e [serve-static] wrapper for koa's middleware.\n\n[![NPM version][npm-img]][npm-url]\n[![NPM Downloads][downloads-image]][npm-url]\n[![Build status][travis-img]][travis-url]\n[![Test coverage][coveralls-img]][coveralls-url]\n[![Dependency status][david-img]][david-url]\n[![License][license-img]][license-url]\n\n## Install\n\n```sh\n$ npm install --save koa-serve-static\n```\n\n## Usage\n\n### **=1.x** 100%, working with `koa-v2`\n\n```js\nconst koa = require('koa');\nconst serveStatic = require('koa-serve-static');\nconst app = new Koa();\n\napp.use(serveStatic(root, options));\n```\n\n### **\u003c1.x**\n\n```js\nvar koa = require('koa');\nvar serveStatic = require('koa-serve-static');\nvar app = koa();\n\napp.use(serveStatic(root, options));\n```\n\n[npm-img]: https://img.shields.io/npm/v/koa-serve-static.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-serve-static\n[travis-img]: https://img.shields.io/travis/koa-modules/serve-static.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koa-modules/serve-static\n[coveralls-img]: https://img.shields.io/coveralls/koa-modules/serve-static.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koa-modules/serve-static?branch=master\n[license-img]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\n[license-url]: LICENSE\n[david-img]: https://img.shields.io/david/koa-modules/serve-static.svg?style=flat-square\n[david-url]: https://david-dm.org/koa-modules/serve-static\n[downloads-image]: https://img.shields.io/npm/dm/koa-serve-static.svg?style=flat-square\n[serve-static]: https://github.com/expressjs/serve-static\n","funding_links":[],"categories":["仓库"],"sub_categories":["中间件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoa-modules%2Fserve-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoa-modules%2Fserve-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoa-modules%2Fserve-static/lists"}