{"id":45713237,"url":"https://github.com/tdb-alcorn/nice-router","last_synced_at":"2026-02-25T03:14:59.748Z","repository":{"id":65459128,"uuid":"75864905","full_name":"tdb-alcorn/nice-router","owner":"tdb-alcorn","description":"Route requests to handlers nicely.","archived":false,"fork":false,"pushed_at":"2017-01-20T00:11:35.000Z","size":17,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:20:20.435Z","etag":null,"topics":["http","node","router","server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdb-alcorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-07T18:41:24.000Z","updated_at":"2016-12-07T18:41:38.000Z","dependencies_parsed_at":"2023-01-24T13:55:11.181Z","dependency_job_id":null,"html_url":"https://github.com/tdb-alcorn/nice-router","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tdb-alcorn/nice-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdb-alcorn%2Fnice-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdb-alcorn%2Fnice-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdb-alcorn%2Fnice-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdb-alcorn%2Fnice-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdb-alcorn","download_url":"https://codeload.github.com/tdb-alcorn/nice-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdb-alcorn%2Fnice-router/sbom","scorecard":{"id":870968,"data":{"date":"2025-08-11","repo":{"name":"github.com/tdb-alcorn/nice-router","commit":"ddf64fecfdac21c44c17cd1985786eb061d07730"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T04:12:04.288Z","repository_id":65459128,"created_at":"2025-08-24T04:12:04.288Z","updated_at":"2025-08-24T04:12:04.288Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29809280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T22:43:48.403Z","status":"online","status_checked_at":"2026-02-25T02:00:07.329Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["http","node","router","server"],"created_at":"2026-02-25T03:14:57.832Z","updated_at":"2026-02-25T03:14:59.727Z","avatar_url":"https://github.com/tdb-alcorn.png","language":"JavaScript","readme":"# nice-router\n\nA nice, simpler router for handling those pesky HTTP(S) requests.\n\n## Example\n\n```javascript\nvar Router = require(\"nice-router\");\nvar router = new Router();\nrouter.addRoute(\"/ping\", \"GET\", function(req, res) {\n    res.writeHead(200);\n    res.end(\"pong\");\n});\nrouter.addStatic(\"/smiley.jpg\", \"image/jpeg\");\nrouter.listen(8080);\n```\n\n### Basic HTTPS example\n\nTo use this example you will need to generate self-signed certificates `server.key` and\n`server.crt`. If you are unsure about how to do that, see this [Stack\nOverflow](http://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl).\n\n```javascript\nvar fs = require(\"fs\");\nvar Router = require(\"nice-router\");\nvar router = new Router();\nrouter.useHTTPS({\n    key: fs.readFileSync(\"key.pem\"),\n    cert: fs.readFileSync(\"cert.pem\"),\n};\nrouter.addRoute(\"/amIEncrypted\", \"GET\", function(req, res) {\n    res.writeHead(200);\n    res.end(\"yes!\");\n});\nrouter.listen(8080);\n```\n\n## Methods\n\n- `#addRoute(path, method, handler)`: Adds a route to the router which will respond to `method`\n  requests to `path` by doing `handler`. The signature of handlers is `handler(request, response,\n  headers, query, body)`. The `request` and `response` objects are the same as those from the node\n  `http`/`https` modules. `headers` and `query` are basic key/value objects. `body` is a Buffer, so\n  call `body.toString(\"utf-8\")` if you just want a string.\n- `#listen(port) -\u003e Promise`: Start the server on the specified port, which must be open.\n- `#close -\u003e Promise`: Stop the server.\n- `#useHTTPS(options[, callback])`: Switches the server to using HTTPS, restarting if the server was already running. `options` is the same as the options parameter in node's `https.createServer`. Accepts an optional `callback` which will be called if the server is restarted.\n- `#addStatic(path, contentType)`: Adds a handler which responds to `GET` requests at `path` with\n  the contents of the file at `path`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdb-alcorn%2Fnice-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdb-alcorn%2Fnice-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdb-alcorn%2Fnice-router/lists"}