{"id":15368014,"url":"https://github.com/anonrig/politics","last_synced_at":"2026-04-10T16:51:43.754Z","repository":{"id":57326915,"uuid":"143886288","full_name":"anonrig/politics","owner":"anonrig","description":"Politics is a simplistic router with async/await support for node.js with a 1.7 kB size.","archived":false,"fork":false,"pushed_at":"2018-08-07T14:52:10.000Z","size":4,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T12:12:40.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/anonrig.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":"2018-08-07T14:37:12.000Z","updated_at":"2018-08-07T16:58:02.000Z","dependencies_parsed_at":"2022-09-13T19:21:46.335Z","dependency_job_id":null,"html_url":"https://github.com/anonrig/politics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Fpolitics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Fpolitics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Fpolitics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Fpolitics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anonrig","download_url":"https://codeload.github.com/anonrig/politics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244879142,"owners_count":20525365,"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-10-01T13:27:42.971Z","updated_at":"2026-04-10T16:51:38.703Z","avatar_url":"https://github.com/anonrig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Politics for node.js\n===\n\nWithout the hassle, without the politics, let's just return json.\n\nUsage\n===\n\n```javascript\nconst Politics = require('politics')\nconst app = new Politics({port: 8000})\nconst router = new Politics.Router()\n\nrouter.get('/', (req, res) =\u003e ({hello: 'world'}))\nrouter.get('/users(/:id)', ({params, query, method}, res) =\u003e ({id: params.id, query, method}))\nrouter.delete('/users(/:id)', ({params, query, method}, res) =\u003e ({id: params.id, query, method}))\nrouter.set404((req, res) =\u003e ({status: 404}))\n\napp.setRouter(router)\n\napp\n  .listen()\n  .then(() =\u003e console.info(`Server listening on port ${app.port}`))\n  .catch(console.error)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonrig%2Fpolitics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonrig%2Fpolitics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonrig%2Fpolitics/lists"}