{"id":18588098,"url":"https://github.com/peimelo/curso_tour_of_heroes_api","last_synced_at":"2025-04-10T14:30:38.176Z","repository":{"id":84827784,"uuid":"327737764","full_name":"peimelo/curso_tour_of_heroes_api","owner":"peimelo","description":"Ruby on Rails 6 course as an API creating a Heroes CRUD.","archived":false,"fork":false,"pushed_at":"2022-11-19T01:22:01.000Z","size":368,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T22:32:12.815Z","etag":null,"topics":["curso","cursoemvideo","rails-api","rspec","ruby-on-rails","tour-of-heroes"],"latest_commit_sha":null,"homepage":"https://curso-tour-of-heroes-api.fly.dev","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/peimelo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-07T22:20:47.000Z","updated_at":"2023-11-24T00:02:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"790b3e83-55ae-46ba-a1b8-fa5692aab39c","html_url":"https://github.com/peimelo/curso_tour_of_heroes_api","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peimelo%2Fcurso_tour_of_heroes_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peimelo%2Fcurso_tour_of_heroes_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peimelo%2Fcurso_tour_of_heroes_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peimelo%2Fcurso_tour_of_heroes_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peimelo","download_url":"https://codeload.github.com/peimelo/curso_tour_of_heroes_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233946,"owners_count":21069493,"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":["curso","cursoemvideo","rails-api","rspec","ruby-on-rails","tour-of-heroes"],"created_at":"2024-11-07T00:44:40.324Z","updated_at":"2025-04-10T14:30:38.158Z","avatar_url":"https://github.com/peimelo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tour Of Heroes API\n\nRuby on Rails 6 course as an API creating a Heroes CRUD.\n\nThis repository is part of the [Curso de Ruby on Rails 6 como API](https://www.youtube.com/watch?v=gTR6lx00Nac\u0026list=PLqsayW8DhUmuvgOX08aXYk6Y-HGrdYg20) on YouTube.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRuby version\u003c/td\u003e\n    \u003ctd\u003e\n      3.0.3\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRails version\u003c/td\u003e\n    \u003ctd\u003e\n      6.1.x\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eDatabase\u003c/td\u003e\n    \u003ctd\u003e\n      SQLite3 (dev) / PostgreSQL (prod)\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Initial settings to run the project\n\n```bash\n# clone the project\ngit clone https://github.com/peimelo/curso_tour_of_heroes_api.git\n\n# enter the cloned directory\ncd curso_tour_of_heroes_api\n\n# install Ruby on Rails dependencies\nbundle install --without production\n\n# create the development and test databases\nrails db:create\n\n# create the tables\nrails db:migrate\n\n# run the project\nrails s\n```\n\nThe backend is available at `http://localhost:3000`.\n\n## Tests\n\n![Tests](https://github.com/peimelo/curso_tour_of_heroes_api/actions/workflows/ruby.yml/badge.svg)\n\nTo run the tests:\n\n```bash\nrspec\n```\n\n## Using the HEROES API\n\n### Include a Header Authorization\n\nFor all requests, use an **Authorization header**, of size \u003e= 10 characters, so that you can only manipulate your data, for example:\n\n```bash\ncurl --request GET \\\n  --url 'https://curso-tour-of-heroes-api.herokuapp.com/api/heroes' \\\n  --header 'Authorization: anyTokenCanBeUsed'\n```\n\n### API Endpoint\n\nThe following endpoints are available:\n\n| Endpoints                   | Usage                                     | Params             |\n| --------------------------- | ----------------------------------------- | ------------------ |\n| `GET /api/heroes`           | Get all of the heroes.                    |                    |\n| `GET /api/heroes?name=term` | Get all heroes with `name` like a `term`. | **term**: [String] |\n| `GET /api/heroes/:id`       | Get the details of a single hero.         |                    |\n| `POST /api/heroes`          | Add a new hero.                           | **name**: [String] |\n| `PUT /api/heroes/:id`       | Edit the details of an existing hero.     | **name**: [String] |\n| `DELETE /api/heroes/:id`    | Remove the hero.                          |                    |\n\n### Using Insomnia to test the API\n\nIf you want to import the above requests into [Insomnia](https://insomnia.rest/download), use the file `Insomnia.json` at the root of this project.\n\nIt will be necessary to install the plugin [insomnia-plugin-dotenv](https://insomnia.rest/plugins/insomnia-plugin-dotenv).\n\nCreate an environment variable file at the root of the project to add sensitive data:\n\n```bash\ntouch .env.development\n```\n\nAdd the contents below to the file above:\n\n```bash\ntoken=anyTokenCanBeUsed\n```\n\nIn Insomnia, go to `Manage Environments` and set the `envFilePath` value to the file path `.env.development`:\n\n```json\n{\n  \"baseUrl\": \"http://localhost:3000/api\",\n  \"envFilePath\": \"/path/to/file/your_repo/.env.development\"\n}\n```\n\nAny `.env.*` file is being ignored by this project's GIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeimelo%2Fcurso_tour_of_heroes_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeimelo%2Fcurso_tour_of_heroes_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeimelo%2Fcurso_tour_of_heroes_api/lists"}