{"id":13508209,"url":"https://github.com/synrc/rest","last_synced_at":"2025-05-08T04:22:50.693Z","repository":{"id":14993403,"uuid":"17718717","full_name":"synrc/rest","owner":"synrc","description":"☕ REST: RFC-2616 Framework","archived":false,"fork":false,"pushed_at":"2025-04-01T09:40:08.000Z","size":94,"stargazers_count":83,"open_issues_count":0,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-02T11:22:41.347Z","etag":null,"topics":["http","json","rest"],"latest_commit_sha":null,"homepage":"https://rest.n2o.dev","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synrc.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":"2014-03-13T17:09:35.000Z","updated_at":"2025-04-01T09:40:12.000Z","dependencies_parsed_at":"2022-08-02T23:45:25.404Z","dependency_job_id":null,"html_url":"https://github.com/synrc/rest","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synrc%2Frest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synrc%2Frest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synrc%2Frest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synrc%2Frest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synrc","download_url":"https://codeload.github.com/synrc/rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252763270,"owners_count":21800456,"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":["http","json","rest"],"created_at":"2024-08-01T02:00:49.772Z","updated_at":"2025-05-08T04:22:50.664Z","avatar_url":"https://github.com/synrc.png","language":"Erlang","readme":"REST: framework with typed JSON\n===============================\n\n[![Actions Status](https://github.com/synrc/rest/workflows/mix/badge.svg)](https://github.com/synrc/rest/actions)\n[![Build Status](https://travis-ci.com/synrc/rest.svg?branch=master)](https://travis-ci.com/synrc/rest)\n[![Hex pm](http://img.shields.io/hexpm/v/rest.svg?style=flat)](https://hex.pm/packages/rest)\n\nFeatures and Goals\n------------------\n\n* Fastest possibe Record \u003c-\u003e Proplists transformations\n* Smallest REST framework in the world\n* ETS/KVS/Any storage selection by scaffolding\n\nWe've achived first goal by providing parse_transform code generation\nfor tuple transformations. And second requirement was achieved\nby not including routing bullshit and other uncertain features.\n\nUsage\n-----\n\nJust plug REST endpoint directly to your Cowboy router:\n\n```erlang\n{\"/rest/:resource\", rest_cowboy, []},\n{\"/rest/:resource/:id\", rest_cowboy, []},\n```\n\nModule\n------\n\nSample REST service implementation:\n\n```erlang\n-module(users).\n-behaviour(rest).\n-compile({parse_transform, rest}).\n-include(\"users.hrl\").\n-export([init/0, populate/1, exists/1, get/0, get/1, post/1, delete/1]).\n-rest_record(user).\n\ninit() -\u003e ets:new(users, [public, named_table, {keypos, #user.id}]).\npopulate(Users) -\u003e ets:insert(users, Users).\nexists(Id) -\u003e ets:member(users, wf:to_list(Id)).\nget() -\u003e ets:tab2list(users).\nget(Id) -\u003e [User] = ets:lookup(users, wf:to_list(Id)), User.\ndelete(Id) -\u003e ets:delete(users, wf:to_list(Id)).\npost(#user{} = User) -\u003e ets:insert(users, User);\npost(Data) -\u003e post(from_json(Data, #user{})).\n```\n\nUsage\n-----\n\n```sh\n$ curl -i -X POST -d \"id=vlad\" localhost:8005/rest/users\n$ curl -i -X POST -d \"id=doxtop\" localhost:8005/rest/users\n$ curl -i -X GET localhost:8005/rest/users\n$ curl -i -X PUT -d \"id=5HT\" localhost:8005/rest/users/vlad\n$ curl -i -X GET localhost:8005/rest/users/5HT\n$ curl -i -X DELETE localhost:8005/rest/users/5HT\n```\n\nCredits\n-------\n\n* Dmitry Bushmelev — ETS\n* Maxim Sokhatsky — KVS\n\nOM A HUM\n","funding_links":[],"categories":["Frameworks"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynrc%2Frest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynrc%2Frest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynrc%2Frest/lists"}