{"repo":"expressjs/serve-static","free":true,"listed":false,"github":"https://github.com/expressjs/serve-static","clone":"git clone https://github.com/expressjs/serve-static.git","description":"Serve static files","language":"JavaScript","stars":1422,"topics":["middleware","javascript","nodejs","expressjs","serve-files","send"],"license":"MIT","category":"dev-tools","readme_excerpt":"serve-static [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![CI][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Install This is a Node.js module available through the npm registry. Installation is done using the npm install command: API serveStatic(root, options) Create a new middleware function to serve files from within a given root directory. The file to serve will be determined by combining req.url with the provided root directory. When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs. Options acceptRanges Enable or disable accepting ranged requests, defaults to true. Disabling this will not send Accept-Ranges and ignore the contents of the Range request header. cacheControl Enable or disable setting Cache-Control response header, defaults to true. Disabling this will ignore the immutable and maxAge options. dotfiles Set how \"dotfiles\" are treated when encountered. A dotfile is a file or directory that begins with a dot (\".\"). Note this check is done on the path itself without checking if the path actually exists on the disk. If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when set to \"deny\"). - 'allow' No special treatment for dotfiles. - 'deny' Deny a request for a dotfile and 403/ next() . -","default_branch":null,"files":null,"tree":[],"storefront":"/r/expressjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/expressjs/serve-static/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}