{"id":18450103,"url":"https://github.com/mathleite/star-wars-planet","last_synced_at":"2025-04-18T00:24:01.266Z","repository":{"id":124155759,"uuid":"378770129","full_name":"mathleite/star-wars-planet","owner":"mathleite","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-21T11:47:58.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T13:44:33.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathleite.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":"2021-06-21T01:02:05.000Z","updated_at":"2021-06-21T11:48:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf6e224e-825d-45d7-8cf3-2a680fc25c8b","html_url":"https://github.com/mathleite/star-wars-planet","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/mathleite%2Fstar-wars-planet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathleite%2Fstar-wars-planet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathleite%2Fstar-wars-planet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathleite%2Fstar-wars-planet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathleite","download_url":"https://codeload.github.com/mathleite/star-wars-planet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167446,"owners_count":21223506,"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-11-06T07:23:26.145Z","updated_at":"2025-04-15T23:03:08.697Z","avatar_url":"https://github.com/mathleite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Planet Api\r\n\r\n### Setup\r\nCreate .env\r\n````shell\r\ncp .env.example .env\r\n````\r\n\r\nBuild and up containers\r\n```shell\r\ndocker-compose up --build -d\r\n```\r\n\r\nRun Tests\r\n````shell\r\ndocker-compose exec node npm test\r\n````\r\n\r\nStart Server\r\n````shell\r\ndocker-compose exec node node ./public/index.js\r\n````\r\n\r\n### Usages for Api\r\n`host`: localhost/planet\r\n\r\n#### Create Planet\r\n- Make **POST** request to *host* with:\r\n````json\r\n{\r\n    \"name\": \"Tatooine\",\r\n    \"climate\": \"arid\",\r\n    \"ground\": \"terrain\"\r\n}\r\n````\r\n\r\nresponse\r\n````json\r\n{\r\n    \"films\": [],\r\n    \"_id\": \"60cfc905ae5f690449b34375\",\r\n    \"name\": \"Tatooine\",\r\n    \"ground\": \"arid\",\r\n    \"climate\": \"terrain\",\r\n    \"createdAt\": \"2021-06-20T23:02:29.405Z\",\r\n    \"updatedAt\": \"2021-06-20T23:02:29.405Z\",\r\n    \"__v\": 0,\r\n    \"id\": \"60cfc905ae5f690449b34375\"\r\n}\r\n````\r\n\r\n#### Find Planet By ID or Name\r\n- Make a **GET** request to `localhost/planet/find?id=60cfc905ae5f690449b34375` find by **ID**\r\n- Make a **GET** request to `localhost/planet/find?name=Tatooine` find by **Name**\r\n\r\n#### Delete a Planet\r\n- Make a **DELETE** request to `localhost/planet/60cfc905ae5f690449b34375`\r\n\r\n#### Get All Planets\r\n- Make a **GET** request to `localhost/planet`\r\n\r\n**response**:\r\n````json\r\n[\r\n    {\r\n        \"films\": [\r\n            {\r\n                \"title\": \"A New Hope\",\r\n                \"release_date\": \"1977-05-25\"\r\n            },\r\n            {\r\n                \"title\": \"Attack of the Clones\",\r\n                \"release_date\": \"2002-05-16\"\r\n            },\r\n            {\r\n                \"title\": \"Return of the Jedi\",\r\n                \"release_date\": \"1983-05-25\"\r\n            },\r\n            {\r\n                \"title\": \"The Phantom Menace\",\r\n                \"release_date\": \"1999-05-19\"\r\n            },\r\n            {\r\n                \"title\": \"Revenge of the Sith\",\r\n                \"release_date\": \"2005-05-19\"\r\n            }\r\n        ],\r\n        \"_id\": \"60cfc7f6d228d1042823788b\",\r\n        \"name\": \"Tatooine\",\r\n        \"ground\": \"arid\",\r\n        \"climate\": \"terrain\",\r\n        \"createdAt\": \"2021-06-20T23:02:29.405Z\",\r\n        \"updatedAt\": \"2021-06-20T23:02:29.405Z\",\r\n        \"__v\": 5,\r\n        \"id\": \"60cfc7f6d228d1042823788b\"\r\n    }\r\n]\r\n````\r\n\r\n#### References:\r\n[cfjedimaster/SWAPI-Wrapper](https://github.com/cfjedimaster/SWAPI-Wrapper)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathleite%2Fstar-wars-planet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathleite%2Fstar-wars-planet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathleite%2Fstar-wars-planet/lists"}