Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamdipankarpaul/post-api-with-expressjs
It is a simple api that I built for practicing CURD operations. Fake post data is ceated by ChatGPT.
https://github.com/iamdipankarpaul/post-api-with-expressjs
expressjs javascript nodejs nodemon pino uuid
Last synced: 16 days ago
JSON representation
It is a simple api that I built for practicing CURD operations. Fake post data is ceated by ChatGPT.
- Host: GitHub
- URL: https://github.com/iamdipankarpaul/post-api-with-expressjs
- Owner: iamdipankarpaul
- Created: 2023-10-15T08:02:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-15T08:53:58.000Z (over 1 year ago)
- Last Synced: 2024-11-11T14:10:37.909Z (3 months ago)
- Topics: expressjs, javascript, nodejs, nodemon, pino, uuid
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple post api using NodeJS and ExpressJS
It is a simple api that I built for practicing CURD operations, but if you still want to try it out, then follow the steps mentioned below 👇
---
## Installation & Usage
- Fork the repository in your account in Github.
- Make project directory and go inside the directory.
- Clone the repository.
- Install dependencies.
- Start or run your API on the local machine.```shell
# Make a directory
mkdir posts-api-expressjs# go inside the directory
cd posts-api-expressjs# Clone the repo
git clone https://github.com/...(repo url)# Install dependencies
npm install# Start the API
npm start# Access the API in your web browser
http://localhost:5000/
```---
## Endpoints
### GET method
```shell
# Home page/route
http://localhost:5000
``````shell
# Get all the posts
http://localhost:5000/posts
``````shell
# Get a single post
http://localhost:5000/posts/:postId
```### POST method
```shell
# Add a new post
http://localhost:5000/posts
```### PATCH method
```shell
# Update a single post
http://localhost:5000/posts/:postId
```### DELETE method
```shell
# Uelete a single post
http://localhost:5000/posts/:postId
```---
## Dependencies
Here are some of the major dependencies I have used in this project:
```json
"dependencies": {
"express": "^4.18.2",
"pino-http": "^8.5.0",
"uuid": "^9.0.1"
},
"devDependencies": {
"nodemon": "^3.0.1",
"pino-pretty": "^10.2.3"
}
```
---## Author
Dipankar Paul 😊 | Contact me 👉 [email protected]