https://github.com/ramgoel/node-postgres-api
A CRUD api for user details made with Express and PostgreSQL
https://github.com/ramgoel/node-postgres-api
backend-api express nodejs-server postgresql
Last synced: 3 months ago
JSON representation
A CRUD api for user details made with Express and PostgreSQL
- Host: GitHub
- URL: https://github.com/ramgoel/node-postgres-api
- Owner: RamGoel
- Created: 2023-08-26T09:24:48.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T16:46:09.000Z (over 2 years ago)
- Last Synced: 2026-01-03T22:26:48.082Z (6 months ago)
- Topics: backend-api, express, nodejs-server, postgresql
- Language: JavaScript
- Homepage: https://node-postgres-api.vercel.app
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# node-postgres-api
A User details CRUD REST API built using expressjs and postgresql.
## Environment Variables
To run this project, you will need to add the following environment variables to your .env file
`POSTGRES_USERNAME` : Username for Postgres
`POSTGRES_PASSWORD` : Password for Postgres
- This repo has CI using Github Actions
## API Reference
#### Get all users
```
GET /user
```
#### Get single user
```
GET /user?id=[id]
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of user to fetch |
#### Add new user
```
POST /user
```
```
{
"fname": "Ram",
"lname": "Goel",
"age": 21,
"email": "ram@habpages.com",
"country": "India"
}
```
#### Update Email of User
```
PUT /user
```
```
{
"email": "ram@habpages.com",
}
```
#### Delete User
```
DELETE /user
```
```
{
"id": "1"
}
```