{"id":16370822,"url":"https://github.com/integralist/sinatra-api","last_synced_at":"2026-03-08T22:30:16.980Z","repository":{"id":140162300,"uuid":"52957818","full_name":"Integralist/sinatra-api","owner":"Integralist","description":"Sinatra example of an API","archived":false,"fork":false,"pushed_at":"2016-03-02T11:30:15.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T13:43:36.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Integralist.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-02T11:29:34.000Z","updated_at":"2016-03-05T00:03:28.000Z","dependencies_parsed_at":"2023-04-07T13:03:59.476Z","dependency_job_id":null,"html_url":"https://github.com/Integralist/sinatra-api","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"9c00376c06c57951de843a450d266df9a25fa0bd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fsinatra-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fsinatra-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fsinatra-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fsinatra-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Integralist","download_url":"https://codeload.github.com/Integralist/sinatra-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239906772,"owners_count":19716581,"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-11T03:06:11.839Z","updated_at":"2026-03-08T22:30:16.924Z","avatar_url":"https://github.com/Integralist.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Page Configuration Service\n\nA simple Sinatra based page configuration service. \n\nIt stores page configuration in local SQLite. Each stored page configuration consists of resource identifier and config part. It's possible to list, retrieve, create, update and delete individual page configuration. List of all configurations currently doesn't support pagination.\n\n### Getting started\n\n#### Install dependencies\n\nRun `bundler`:\n\n    $ bundle install\n\n#### Run Migrations\n\n    $ bundle exec rake db:migrate\n\n    and \n\n    $ RACK_ENV=test bundle exec rake db:migrate\n\n#### Launch the API server\n\n    $ bundle exec rackup\n\nIt'll start Thin server on default port 9292.\n\n### Tests\n\n    $ bundle exec rspec\n\n### IMPORTANT Assumptions\n\nThis API assumes that new page configuration is provided as well formatted JSON. This configuration *must* include `id` field which value is used to identify resource. `id` must not contain spaces or non-alphanumeric character to ensure correct operation. `id` will be sanitised at the time of resource creation to remove all non-alphanumeric characters. Other than that, configuration JSON must include at least one configuration key with appropriate value. There is no limit of number or naming convention of other configuration keys.\n\n#### Example configuration\n\n    {\n      \"id\": \"pageId\",\n      \"key1\": \"value1\",\n      \"key2\": \"value2\",\n      ...\n      \"keyN\": \"valueN\"\n    }\n\n### Versioning\n\nThis service uses API versioning. Currently all service endpoints are namespaced with `/v1`.\n\n### Usage\n\n#### GET /v1/pages \n\nIt will return collection of all stored page configuration. Currently this endpoint doesn't support pagination. \n\n##### Example request\n\n    curl -H \"Accept: application/json\" http://localhost:9292/v1/pages\n\n##### Example response\n\n    {\n      \"page\": [\n        {\n          \"id\": \"foo\",\n          \"config\": {\n            \"value\": \"some value\"\n          }\n        },\n        {\n          \"id\": \"bar\",\n          \"config\": {\n            \"key\": \"value\"\n          }\n        }\n      ]\n    }\n\n##### Statuses\n\n  `200` - successful response.\n\n#### GET /v1/pages/:page_identifier\n\nIt will return page configuration resource for given identifier.\n\n##### Example request\n\n    curl -H \"Accept: application/json\" http://localhost:9292/v1/pages/foo\n\n##### Example response\n\n    {\n      \"page\": {\n        \"id\": \"foo\",\n        \"config\": {\n          \"value\": \"some value\"\n        }\n      }\n    }\n\n##### Errors\n  `404` - returned when requested resource wasn't found.\n\n##### Statuses\n  `200` - successful response.\n\n#### POST /v1/pages\n\nIt will create a new page configuration resource. \n\n##### Example request\n\n    curl -H \"Accept: application/json\" \\\n         -X POST \\\n         -d '{\"id\": \"foo\",\"value\": \"I am foo\"}' \\ \n         http://localhost:9292/v1/pages\n\n##### Example response\n\n  Response should contain `Location` header with newly created resource URI.\n\n##### Errors\n  `409` - returned when resource already exists.\n  `500` - returned when there was an issue when creating new resource.\n\n##### Statuses\n  `201` - returned when resource was succesfully created.\n\n\n#### PUT /v1/pages/:page_identifier\n\nIt will update existing page configuration for specified resource.\n\n##### Example request\n\n    curl -H \"Accept: application/json\" \\\n         -X PUT \\\n         -d '{\"id\": \"foo\", \"value\": \"Some new value\"}' \\ \n         http://localhost:9292/v1/pages/foo\n\n##### Example response\n\n  No content.\n\n##### Errors\n  `404` - returned when requested resource doensn't exist.\n  `409` - returned when there was page identifier mismatch between updated resource and the one from new configuration (\"id\" field value).\n\n##### Statuses\n  `204` - No content is returned when operation was succesful.\n\n\n#### DELETE /v1/pages/:page_identifier\n\nIt will delete existing page configuration for specified resource.\n\n##### Example request\n\n    curl -H \"Accept: application/json\" \\\n         -X DELETE \\\n         http://localhost:9292/v1/pages/foo\n\n##### Example response\n\n  No content.\n\n##### Errors\n  `404` - returned when requested resource doensn't exist.\n\n##### Statuses\n  `204` - No content is returned when operation was succesful.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fsinatra-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegralist%2Fsinatra-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fsinatra-api/lists"}