gem “grape”
Structure files as in /api
Route
mount API::Base => '/api'
Swagger documentation
gem ‘grape-swagger’
Clone swagger UI: github.com/wordnik/swagger-ui
Copy dist content to public/api/docs
Change this line:
window.swaggerUi = new SwaggerUi({
// url: "http://petstore.swagger.wordnik.com/api/api-docs", url: "/api/swagger_doc.json", // <---- HERE dom_id: "swagger-ui-container",
After this you can check the API documentation and test it on: localhost:3000/api/docs/