{"id":17323931,"url":"https://github.com/strugee/node-serve-random","last_synced_at":"2026-01-06T18:10:32.907Z","repository":{"id":56032584,"uuid":"95278869","full_name":"strugee/node-serve-random","owner":"strugee","description":"Express middleware that responds with random files","archived":false,"fork":false,"pushed_at":"2024-09-24T06:08:38.000Z","size":192,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T08:50:01.318Z","etag":null,"topics":["express","express-middleware","hacktoberfest","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strugee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","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":"2017-06-24T05:59:25.000Z","updated_at":"2024-09-24T06:08:41.000Z","dependencies_parsed_at":"2024-12-30T12:45:35.127Z","dependency_job_id":"1316ecc6-5fab-41d4-98dd-988c0fbc5479","html_url":"https://github.com/strugee/node-serve-random","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":0.07317073170731703,"last_synced_commit":"fbcd62ba636627ccec735efcbc54483fc2e50d64"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-serve-random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-serve-random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-serve-random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strugee%2Fnode-serve-random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strugee","download_url":"https://codeload.github.com/strugee/node-serve-random/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240229966,"owners_count":19768594,"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":["express","express-middleware","hacktoberfest","javascript","nodejs"],"created_at":"2024-10-15T14:09:37.026Z","updated_at":"2026-01-06T18:10:32.881Z","avatar_url":"https://github.com/strugee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-serve-random\n\n[![Build Status](https://travis-ci.org/strugee/node-serve-random.svg?branch=master)](http://travis-ci.org/strugee/node-serve-random)\n[![Coverage Status](https://coveralls.io/repos/github/strugee/node-serve-random/badge.svg?branch=master)](https://coveralls.io/github/strugee/node-serve-random?branch=master)\n[![Greenkeeper badge](https://badges.greenkeeper.io/strugee/node-serve-random.svg)](https://greenkeeper.io/)\n\nServe random files\n\nVaguely API-compatible with [serve-static][].\n\n## API\n\n### serveRandom(root, options)\n\nCreate a new middleware function to serve files from within a given root directory. With each inbound request, a random file will be selected from the given root directory. The module will not recurse into subdirectories.\n\nThe response's max-age is always set to 0.\n\n#### Options\n\n##### fallthrough\n\nSet the middleware to have errors (clients using an HTTP method other than `GET` or `HEAD`, or `root` being empty) fall-through as just unhandled requests, otherwise forward a client error. The difference is that client errors will cause this middleware to simply `next()` to your next middleware when this value is `true`. When this value is `false`, these errors (even 404s), will invoke `next(err)`.\n\nDefaults to `true`.\n\n## Acknowledgments\n\nThis module heavily borrows code from [serve-static][] - many thanks to the great people who work on that module.\n\n## License\n\nLGPL 3.0+\n\n## Author\n\nAJ Jordan \u003calex@strugee.net\u003e\n\n [serve-static]: https://github.com/expressjs/serve-static\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrugee%2Fnode-serve-random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrugee%2Fnode-serve-random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrugee%2Fnode-serve-random/lists"}