{"id":17987339,"url":"https://github.com/taniarascia/node-api-postgres","last_synced_at":"2025-03-25T22:32:00.319Z","repository":{"id":45193276,"uuid":"151341947","full_name":"taniarascia/node-api-postgres","owner":"taniarascia","description":"RESTful API with Node.js, Express, and Postgres.","archived":false,"fork":false,"pushed_at":"2022-03-30T04:50:50.000Z","size":12,"stargazers_count":90,"open_issues_count":3,"forks_count":53,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-02-26T08:03:20.236Z","etag":null,"topics":["api","crud","crud-app","database","express","node","nodejs","postgres","postgresql","rest","restful-api"],"latest_commit_sha":null,"homepage":"https://blog.logrocket.com/setting-up-a-restful-api-with-node-js-and-postgresql-d96d6fc892d8/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taniarascia.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}},"created_at":"2018-10-03T00:33:30.000Z","updated_at":"2023-02-01T20:12:41.000Z","dependencies_parsed_at":"2022-08-06T01:15:38.013Z","dependency_job_id":null,"html_url":"https://github.com/taniarascia/node-api-postgres","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fnode-api-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fnode-api-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fnode-api-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fnode-api-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taniarascia","download_url":"https://codeload.github.com/taniarascia/node-api-postgres/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222099526,"owners_count":16931430,"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":["api","crud","crud-app","database","express","node","nodejs","postgres","postgresql","rest","restful-api"],"created_at":"2024-10-29T19:08:32.134Z","updated_at":"2024-10-29T19:08:32.735Z","avatar_url":"https://github.com/taniarascia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RESTful API with Node.js, Express, and Postgres\n\nCreate, read, update, delete in a Node.js app with an Express server and Postgres database.\n\n### [Read the tutorial](https://blog.logrocket.com/setting-up-a-restful-api-with-node-js-and-postgresql-d96d6fc892d8/)\n\n## Database\n\n```bash\nbrew install postgresql\nbrew services start postgresql\npsql postgres\n```\n\n```sql\nCREATE ROLE me WITH LOGIN PASSWORD 'password';\nALTER ROLE me CREATEDB;\nCREATE DATABASE api;\nGRANT ALL PRIVILEGES ON DATABASE api TO me;\n```\n\n```bash\npsql -d api -U me\n```\n\n```sql\nCREATE TABLE users (\n  ID SERIAL PRIMARY KEY,\n  name VARCHAR(30),\n  email VARCHAR(30)\n);\n\nINSERT INTO users (name, email)\n  VALUES ('Jerry', 'jerry@example.com'), ('George', 'george@example.com');\n```\n\n## Installation\n\n```bash\ngit clone git@github.com:taniarascia/node-api-postgres\ncd node-api-postgres\nnpm install\nnode index.js\n```\n\n## Commands\n\n- GET: `curl http://localhost:3000/users`\n- POST: `curl --data \"name=Jerry\u0026email=jerry@example.com\" http://localhost:3000/users`\n- PUT: `curl -X PUT -d \"name=George\" -d \"email=george@example.com\" http://localhost:3000/users/1`\n- DELETE: `curl -X \"DELETE\" http://localhost:3000/users/1`\n\n## Author\n\n- [Tania Rascia](https://www.taniarascia.com)\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniarascia%2Fnode-api-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaniarascia%2Fnode-api-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniarascia%2Fnode-api-postgres/lists"}