{"id":16547246,"url":"https://github.com/rg3915/rest-api-flask","last_synced_at":"2026-05-18T15:39:13.910Z","repository":{"id":141205769,"uuid":"362097002","full_name":"rg3915/rest-api-flask","owner":"rg3915","description":"Learning REST API Flask 2021.","archived":false,"fork":false,"pushed_at":"2021-05-02T02:47:07.000Z","size":48,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-10T21:37:34.018Z","etag":null,"topics":["flask"],"latest_commit_sha":null,"homepage":"","language":"Python","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/rg3915.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-04-27T12:03:09.000Z","updated_at":"2022-07-28T10:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7506a5cc-f827-4a18-a1d8-404c2a22eb3d","html_url":"https://github.com/rg3915/rest-api-flask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rg3915/rest-api-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rg3915%2Frest-api-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rg3915%2Frest-api-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rg3915%2Frest-api-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rg3915%2Frest-api-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rg3915","download_url":"https://codeload.github.com/rg3915/rest-api-flask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rg3915%2Frest-api-flask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33183276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["flask"],"created_at":"2024-10-11T19:13:56.096Z","updated_at":"2026-05-18T15:39:13.878Z","avatar_url":"https://github.com/rg3915.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rest-api-flask\n\nLearning REST API Flask\n\n\n## Este projeto foi feito com:\n\n* [Python 3.8.9](https://www.python.org/)\n* [Flask 1.1.2](https://flask.palletsprojects.com/en/1.1.x/)\n\n## Como rodar o projeto?\n\n* Clone esse repositório.\n* Crie um virtualenv com Python 3.\n* Ative o virtualenv.\n* Instale as dependências.\n* Rode as migrações.\n\n```\ngit clone https://github.com/rg3915/rest-api-flask.git\ncd rest-api-flask\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\npython contrib/env_gen.py\npython app.py\n```\n\n```python\n# POST /store data: {name:}\n# GET /store/\u003cstring:name\u003e\n# GET /store\n# POST /store/\u003cstring:name\u003e/item {name:, price:}\n# GET /store/\u003cstring:name\u003e/item\n```\n\n## Chamando a API com Postman\n\n\n```\nPOST\nhttp://localhost:5000/store\nContent-Type:application/json\n\n{\n    \"name\": \"Another Store\"\n}\n```\n\n```\nPOST\nhttp://localhost:5000/store/My Wonderful Store/item\nContent-Type:application/json\n\n{\n    \"name\": \"Another item\",\n    \"price\": 10.99\n}\n```\n\n```\nPOST\nhttp://localhost:5000/item/\u003cname\u003e\nContent-Type:application/json\n\n{\n    \"price\": 12.99\n}\n```\n\n\n## Usando sqlite\n\n```\npython test.py\n```\n\n## Rodando a aplicação novamente\n\n```\npython section5/code/app.py\n```\n\n## Section 5\n\n```\ncd section5/code\npython create_tables.py\npython app.py\n```\n\n## Section 6\n\n```\ncd section6/code\npython create_tables.py\npython app.py\n```\n\n### Advanced Postman\n\nDefina url como `{{url}}`.\n\nE em Manage environments defina\n\n```\nurl: http://127.0.0.1:5000\n```\n\nE em `{{url}}/item/test` defina `JWT {{jwt_token}}`.\n\nEm `/auth` crie um `Tests`.\n\n```js\nvar jsonData = JSON.parse(responseBody);\ntests[\"Your test name\"] = jsonData.access_token !== undefined;\n\npm.environment.set(\"jwt_token\", jsonData.access_token);\n```\n\nCrie um test em `/items`\n\n```js\npm.test(\"Status code is 200\", function () {\n    pm.response.to.have.status(200);\n});\n\npm.test(\"Response time is less than 200ms\", function () {\n    pm.expect(pm.response.responseTime).to.be.below(200);\n});\n```\n\nCrie um test em `POST /items/\u003cname\u003e`\n\n```\npm.test(\"Status code is 201\", function () {\n    pm.response.to.have.status(201);\n});\n\npm.test(\"Response time is less than 200ms\", function () {\n    pm.expect(pm.response.responseTime).to.be.below(200);\n});\n```\n\n## Links\n\nhttps://github.com/tecladocode/rest-api-sections\n\nhttps://github.com/schoolofcode-me/stores-rest-api  # deploy on Heroku\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frg3915%2Frest-api-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frg3915%2Frest-api-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frg3915%2Frest-api-flask/lists"}