{"id":15497351,"url":"https://github.com/heapwolf/literate-router","last_synced_at":"2025-04-22T22:29:19.205Z","repository":{"id":66203343,"uuid":"74922901","full_name":"heapwolf/literate-router","owner":"heapwolf","description":"markdown powered routing","archived":false,"fork":false,"pushed_at":"2017-10-24T17:27:54.000Z","size":10,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T09:17:01.396Z","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/heapwolf.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-28T00:21:54.000Z","updated_at":"2019-07-11T16:17:31.000Z","dependencies_parsed_at":"2023-03-01T09:30:48.621Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/literate-router","commit_stats":null,"previous_names":["0x00a/literate-router"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fliterate-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fliterate-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fliterate-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fliterate-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/literate-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333688,"owners_count":21413437,"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-02T08:33:04.637Z","updated_at":"2025-04-22T22:29:19.159Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nMarkdown powered routing for building http based APIs. A generalized routing\nsystem meant to be both abstracted and self-documenting.\n\n# MOTIVATION\nDon't allow routing to become tangled with implementations. Enforce\nmarkdown based documentation so it can be served as an endpoint. A single\ncanonical reference can also be used to test routes reliably.\n\n# SYNTAX\nLines that are indented using two or more spaces or one or more tabs) are\nparsed. All other lines are ignored (considered to be documentation). Arguments\n(arbitrary string values separated by commas) are optional.\n\n```\nLorem Ipsum is simply dummy text of the printing and typesetting industry.\nLorem Ipsum has been the industry's standard dummy text ever since the 1500s.\n\n  METHOD ROUTE PATH (P1, P2, ...)\n\nLorem Ipsum is simply dummy text of the printing and typesetting industry.\nLorem Ipsum has been the industry's standard dummy text ever since the 1500s\n\n  METHOD ROUTE PATH (P1, P2, ...)\n  METHOD ROUTE PATH (P1, P2, ...)\n```\n\n### METHOD\nA regular expression, matching the http method, for example `GET|PUT`.\n\n### ROUTE\nA tokenized route, for example `/books/:page`, see\n[this](https://github.com/pillarjs/path-to-regexp#parameters) documentation.\n\n### PATH\nA path to a file that exports one or more functions to handle testing and\nfullfilling the request.\n\n### (P1, P2, ...)\nAn array of arbitrary parameters that can be passed to the supplied functions.\n\n# USAGE\n## ROUTES.MD\n```md\nLorem Ipsum is simply dummy text of the printing and typesetting industry.\nLorem Ipsum has been the industry's standard dummy text ever since the 1500s.\n\n  GET /books routes/books (5000/hr)\n  PUT|POST /books/:book routes/books (10000/hr)\n```\n\n## SERVER.JS\n```js\nconst http = require('http')\nconst Router = require('literate-router')\nconst send = require('send')\nconst fs = require('fs')\n\nfunction nonmatch (req, res) {\n  send(req, req.url).pipe(res)\n}\n\nfunction match (req, res, context, next) {\n  next()\n}\n\nconst routes = fs.readFileSync('./routes.md', 'utf8')\nconst router = Router(routes, match, nonmatch)\n\nhttp.createServer(router).listen(8080)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fliterate-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fliterate-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fliterate-router/lists"}