{"id":17055200,"url":"https://github.com/jimmyhmiller/instarest","last_synced_at":"2026-05-03T13:35:49.015Z","repository":{"id":76135282,"uuid":"86277211","full_name":"jimmyhmiller/instarest","owner":"jimmyhmiller","description":"Create a Rest Api instantly","archived":false,"fork":false,"pushed_at":"2017-03-27T01:16:16.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T12:44:05.915Z","etag":null,"topics":["prototype","rest-api"],"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/jimmyhmiller.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":"2017-03-27T01:15:00.000Z","updated_at":"2017-03-27T01:17:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd524cfb-3d52-45f8-8e7a-dd5914b92b58","html_url":"https://github.com/jimmyhmiller/instarest","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/jimmyhmiller%2Finstarest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyhmiller%2Finstarest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyhmiller%2Finstarest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyhmiller%2Finstarest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmyhmiller","download_url":"https://codeload.github.com/jimmyhmiller/instarest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061373,"owners_count":20554563,"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":["prototype","rest-api"],"created_at":"2024-10-14T10:17:36.771Z","updated_at":"2026-05-03T13:35:43.977Z","avatar_url":"https://github.com/jimmyhmiller.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instarest\n\nVery much in prototype stage. The goal is an instant rest api for rapid prototyping that you can slowly evolve by interacting with the running system.\n\nRight now, you can use GET, PUT, PATCH, POST, and DELETE on any entity. Url schema is `/:collection/:id`.\n\nHere's an example.\n\n#### Create User\n\n```http\nPOST /users HTTP/1.1\nAccept: application/json\nContent-Type: application/json; charset=utf-8\n\n{\n    \"name\": \"Jimmy\"\n}\n```\n\n##### Reponse\n\n```http\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n\n{\n    \"id\": \"82f3f82d-b4d7-4b56-a7c0-33d35a187c79\", \n    \"name\": \"Jimmy\"\n}\n```\n\n#### Get all users\n\n```http\nGET /users HTTP/1.1\n```\n\n##### Response\n\n```http\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n\n[\n    {\n        \"id\": \"82f3f82d-b4d7-4b56-a7c0-33d35a187c79\", \n        \"name\": \"Jimmy\"\n    }\n]\n```\n\nThe only special endpoint right now is `/validation/:collection`. You can use [validatejs](http://validatejs.org/) validations to add validations to endpoints.\n\n#### Add User Validation\n\n```http\nPUT /validation/users HTTP/1.1\nAccept: application/json\nContent-Type: application/json; charset=utf-8\n\n{\n    \"name\": {\n        \"presence\": true\n    }\n}\n```\n\n##### Response\n\n```http\nHTTP/1.1 204 No Content\n```\n\n#### Try Adding Invalid User\n\n```http\nPOST /users HTTP/1.1\nAccept: application/json\nContent-Type: application/json; charset=utf-8\n\n{\n    \"stuff\": \"Jimmy\"\n}\n\n```\n\n##### Response\n\n```http\nHTTP/1.1 400 Bad Request\nContent-Type: application/json; charset=utf-8\n\n{\n    \"errors\": {\n        \"name\": [\n            \"name can't be blank\"\n        ]\n    }\n}\n```\n\n\n\n## Future plans\n\nRight now you can add validations and old data will not be validated. I plan on adding a way to migrate old data if any validations conflict. Currently all data is just in memory, the plan is to add middleware for your own storage. One thought I've had with regard to this is a way to do migrations. That way even with an in memory version, you could spin up a new version and migrate data over. I'd love to be able to add queries to endpoints. Validations currently only work on the body, headers should be an easy addition. By allowing header validation, we can automatically get authentication.  \n\nI'd love to also be able to add onto the validation system. Not quite sure how to do this, but one idea is to allow validations to be an endpoint to allow any application to implement validations. In fact, this idea would allow nesting of validations for related entities. \n\nOne possible future approach is to use datascript. It would allow querying, and allow endpoints that are a subset of current fields using the pull api.\n\nMy motivation for working on this is to try and make a modern mini version of [PILOT by Warren Teitelman](https://dspace.mit.edu/bitstream/handle/1721.1/6905/AITR-221.pdf?sequence=2). I must admit I actually haven't read it full, but really enjoyed the description in [Marvin Minsky's Paper](http://web.media.mit.edu/~minsky/papers/Why%20programming%20is--.html) (which I did read). This is a far cry from PILOT. Even if I developed all the features I want it would still not be what Teitelman describes. But the way in which it works is precisely what Teitelman describes. You would not develop by writing code in a text file, but by sending \"advice\" to the running system, telling it how to interpret future inputs. I find this to be a compelling way to implement APIs and would love to have a system to explore these notions.\n\nOne area that is still unclear to me is the transition from dev to prod. One possibility is to use this only in dev in the initial stages, using a proxy to replace endpoint by endpoint witha real service. But more interesting to me is the ability to migrate a running system to prod. How would this work? I have no idea.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmyhmiller%2Finstarest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmyhmiller%2Finstarest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmyhmiller%2Finstarest/lists"}