{"repo":"igorkasyanchuk/fake_api","free":true,"listed":false,"github":"https://github.com/igorkasyanchuk/fake_api","clone":"git clone https://github.com/igorkasyanchuk/fake_api.git","description":"The fastest way to prototype API in your Rails application","language":"Ruby","stars":142,"topics":["rails","rails-api","rails-json-api","ruby-on-rails","ruby","api"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Fake API The fastest way to prototype API with most real dummy data, and provide them to other team members. Instead of creating many new controllers and actions, and sending random data like \"First name #{rand(100)}\" you'll get real data for developing/testing. Gem has a syntax similar to rails routes, factory bot, and uses faker to generate dummy data. Features: fast API prototyping clear and familiar syntax Faker for test data generation including links to images if needed manage cookies, session, headers with fake response executes your factories in real-time, so you always get fresh and random data has generator has standalone mode (see documentation for more details) Installation & Usage Installation process is very simple. - add gem 'fake api' to the Gemfile - run bundle install - mount gem in routes.rb mount FakeApi::Engine = '/api' - rails g fake api Product . It will generate factory and routing files. - edit app/fake api/ .rb , define your routing and factories. - open localhost:300/api/projects.json (see step 5) or localhost:300/api/projects.xml (to return XML in API response) - profit :) You can keep your routing and factories in many files. Examples Sample of the factory: And sample of routing: Factory Methods - create list(:factory name, 10) to create an array of 10 factories. - object(:factory nane) to return a factory Routing Methods - get/post/put/patch/delete to define route - and return to specify the response. This response will be converted to FORMAT (js","default_branch":null,"files":null,"tree":[],"storefront":"/r/igorkasyanchuk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/igorkasyanchuk/fake_api/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}