{"id":30059965,"url":"https://github.com/tiaanduplessis/apit","last_synced_at":"2025-08-08T01:41:11.349Z","repository":{"id":57182207,"uuid":"99229277","full_name":"tiaanduplessis/apit","owner":"tiaanduplessis","description":"JSON/Object to REST API with zero effort","archived":false,"fork":false,"pushed_at":"2020-06-07T02:54:59.000Z","size":221,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T05:49:05.081Z","etag":null,"topics":["api","brewski","cli","localhost","server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaanduplessis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-03T12:16:44.000Z","updated_at":"2022-05-30T09:46:23.000Z","dependencies_parsed_at":"2022-09-14T06:00:38.826Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/apit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/apit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fapit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fapit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fapit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fapit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/apit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fapit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268635523,"owners_count":24281951,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":["api","brewski","cli","localhost","server"],"created_at":"2025-08-08T01:40:58.980Z","updated_at":"2025-08-08T01:41:11.329Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003eapit\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eJSON/Object to REST API with zero effort\u003c/strong\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/apit\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/apit.svg?style=flat-square\" alt=\"npm package version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/apit\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dm/apit.svg?style=flat-square\" alt=\"npm downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/feross/standard\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\" alt=\"standard JS linter\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square\" alt=\"prettier code formatting\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/tiaanduplessis/apit\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/tiaanduplessis/apit.svg?style=flat-square\" alt=\"travis ci build status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tiaanduplessis/apit/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/apit.svg?style=flat-square\" alt=\"project license\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\" alt=\"make a pull request\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tiaanduplessis/apit/watchers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/watchers/tiaanduplessis/apit.svg?style=social\" alt=\"Github Watch Badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tiaanduplessis/apit/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/tiaanduplessis/apit.svg?style=social\" alt=\"Github Star Badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/intent/tweet?text=Check%20out%20apit!%20https://github.com/tiaanduplessis/apit%20%F0%9F%91%8D\"\u003e\n    \u003cimg src=\"https://img.shields.io/twitter/url/https/github.com/tiaanduplessis/apit.svg?style=social\" alt=\"Tweet\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  Built with ❤︎ by \u003ca href=\"https://github.com/tiaanduplessis\"\u003etiaanduplessis\u003c/a\u003e and \u003ca href=\"https://github.com/tiaanduplessis/apit/contributors\"\u003econtributors\u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003cli\u003e\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#install\"\u003eInstall\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#caveats\"\u003eCaveats\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#contribute\"\u003eContribute\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n\u003c/details\u003e\n\n\n## About\n\nThe package takes `json` or plain `object` and turns it into a RESTful API server running on a given port (defaults to `8000`).\n\n\n## Install\n\n```sh\n$ npm install apit\n# OR\n$ yarn add apit\n```\n\nOr to use as CLI:\n\n```sh\n$ npm -g install apit\n# OR\n$ yarn global add apit\n```\n\n## Usage\n\n```js\nconst apit = require('apit')\n\nconst data = {\n  posts: {\n    foo: {\n      message: 'hello'\n    }\n  },\n  other: 'foo',\n  baz: [1,2,3],\n  food: {\n    steal: {\n      healthy: true\n    }\n  }\n}\n\napit(data)\n{\"pid\":54578,\"hostname\":\"Tiaan-FF-Mac.local\",\"name\":\"brewski\",\"level\":30,\"time\":1501775589826,\"msg\":\"Server listening at http://localhost:3000\",\"v\":1}\n\n```\n\nThe above example will create the following routes with associated values:\n\n- **/** - {\"posts\":{\"foo\":{\"message\":\"hello\"}},\"other\":\"foo\",\"baz\":[1,2,3],\"food\":{\"steal\":{\"healthy\":true}}}\n- **/posts** - {\"foo\":{\"message\":\"hello\"}}\n- **/posts/foo** - {\"message\":\"hello\"}\n- **/posts/foo/message** - \"hello\"\n- **/other** - \"foo\"\n- **/baz** - [1,2,3]\n- **/food** - {\"steal\":{\"healthy\":true}}\n- **/food/steal** - {\"healthy\":true}\n- **/food/steal/healthy** - true\n\nIf you install the module globally, you can also use it with a `json` file or module that exports a `object`:\n\n```sh\napit --file=example.json\n# {\"pid\":56017,\"hostname\":\"Tiaan-FF-Mac.local\",\"name\":\"brewski\",\"level\":30,\"time\":1501776268494,\"msg\":\"Server listening at http://localhost:8000\",\"v\":1}\n```\n\n## Caveats\n\nCurrently only `GET` requests are supported.\n\n## Contributing\n\nContributions are welcome!\n\n1. Fork it.\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\nOr open up [a issue](https://github.com/tiaanduplessis/apit/issues).\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fapit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fapit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fapit/lists"}