{"id":13394977,"url":"https://github.com/crepe/crepe","last_synced_at":"2026-03-14T12:17:29.863Z","repository":{"id":4201664,"uuid":"5321179","full_name":"crepe/crepe","owner":"crepe","description":"🥞 The thin API stack.","archived":false,"fork":false,"pushed_at":"2017-12-10T05:57:23.000Z","size":442,"stargazers_count":128,"open_issues_count":7,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-07-31T17:23:26.534Z","etag":null,"topics":["api","fast","lightweight","rack","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/crepe.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}},"created_at":"2012-08-06T23:53:04.000Z","updated_at":"2024-04-14T05:20:34.000Z","dependencies_parsed_at":"2022-09-09T08:02:55.120Z","dependency_job_id":null,"html_url":"https://github.com/crepe/crepe","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/crepe%2Fcrepe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crepe%2Fcrepe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crepe%2Fcrepe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crepe%2Fcrepe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crepe","download_url":"https://codeload.github.com/crepe/crepe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478253,"owners_count":20297220,"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":["api","fast","lightweight","rack","ruby"],"created_at":"2024-07-30T17:01:38.026Z","updated_at":"2025-12-18T10:22:21.337Z","avatar_url":"https://github.com/crepe.png","language":"Ruby","readme":"# Crepe [![Build Status][1]][2] [![Code Climate][3]][4]\n\nCrepe is a lightweight API framework designed to help you write clean, fast web\nservices in Ruby. With an elegant and intuitive DSL inspired by RSpec, and with\na nod to Grape, Crepe makes API design simple.\n\n[1]: https://img.shields.io/travis/crepe/crepe.svg?style=flat\n[2]: https://travis-ci.org/crepe/crepe\n[3]: https://img.shields.io/codeclimate/maintainability/crepe/crepe.svg?style=flat\u0026label=code%20climate\n[4]: https://codeclimate.com/github/crepe/crepe\n\n## Installation\n\nIn your application's Gemfile:\n\n```ruby\ngem 'crepe', github: 'crepe/crepe'\n```\n\nIf you're coming from Rails and/or you want a Crepe application with a\nthought-out file structure, you can use [creperie][creperie] to generate a new\nAPI:\n\n```bash\n$ gem install creperie --pre\n$ crepe new my_api\n```\n\n[creperie]: https://github.com/crepe/creperie\n\n## Usage\n\nCrepe APIs are, at their core, Rack applications. They can be created by\nsubclassing `Crepe::API`. To detail Crepe's major features, we'll show how\n[GitHub's Gist API][gist-api] could be written using Crepe:\n\n[gist-api]: https://developer.github.com/v3/gists/\n\n```ruby\n# config.ru\nrequire 'bundler/setup'\nrequire 'crepe'\n\nmodule Gist\n  class API \u003c Crepe::API\n    # Like `let` in RSpec, this defines a lazy-loading helper.\n    let(:current_user) { User.authorize!(request.headers['Authorization']) }\n\n    namespace :gists do\n      let(:gist_params) { params.slice(:files, :description, :public) }\n\n      get do\n        begin\n          current_user.gists.limit(30)\n        rescue User::Unauthorized\n          Gist.limit(30)\n        end\n      end\n\n      post { Gist.create(gist_params) }\n\n      get(:public) { Gist.limit(30) }\n\n      get(:starred) { current_user.starred_gists }\n\n      # Specify a parameter as part of the namespace: /gists/:id/...\n      param :id do\n        let(:gist) { Gist.find(params[:id]) }\n\n        get    { gist }\n        put    { gist.update_attributes(gist_params) }\n        patch  { gist.update_attributes(gist_params) }\n        delete do\n          if gist.user == current_user\n            gist.destroy and head :no_content\n          else\n            error! :unauthorized\n          end\n        end\n\n        # Specify a parameter constraint, e.g. a 40-character hex string\n        param(sha: /\\h{40}/) { gist.revisions.find(params[:sha]) }\n        get(:commits) { gist.commits.limit(30) }\n\n        get :star do\n          if current_user.starred?(gist)\n            head :no_content\n          else\n            head :not_found\n          end\n        end\n        put(:star)    { current_user.star(gist) }\n        delete(:star) { current_user.unstar(gist) }\n\n        get(:forks)  { gist.forks.limit(30) }\n        post(:forks) { current_user.fork(gist) }\n      end\n    end\n\n    rescue_from ActiveRecord::RecordNotFound do |e|\n      error! :not_found, e.message\n    end\n\n    rescue_from ActiveRecord::InvalidRecord do |e|\n      error! :unprocessable_entity, e.message, errors: e.record.errors\n    end\n\n    rescue_from User::Unauthorized do |e|\n      unauthorized! realm: 'Gist API'\n    end\n  end\nend\n\nrun Gist::API\n```\n\nThe above example will give you a Rack application that you can run with the\n`rackup` command, responding to the following routes:\n\n```\nGET    /gists\nPOST   /gists\nGET    /gists/public\nGET    /gists/starred\nGET    /gists/:id\nPUT    /gists/:id\nPATCH  /gists/:id\nDELETE /gists/:id\nGET    /gists/:id/:sha\nGET    /gists/:id/commits\nGET    /gists/:id/star\nPUT    /gists/:id/star\nDELETE /gists/:id/star\nGET    /gists/:id/forks\nPOST   /gists/:id/forks\n```\n\n## Advanced usage\n\nThe above example only skims the surface of what Crepe can do. For more\ninformation, see the [Crepe wiki][wiki].\n\n[wiki]: https://github.com/crepe/crepe/wiki\n\n## License\n\n(The MIT License.)\n\n© 2013–2015 Stephen Celis \u003cstephen@stephencelis.com\u003e, Evan Owen \u003ckainosnoema@gmail.com\u003e, David Celis \u003cme@davidcel.is\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":["Ruby","API Builder","Frameworks","API Builder and Discovery","Web framework for Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrepe%2Fcrepe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrepe%2Fcrepe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrepe%2Fcrepe/lists"}