Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamdipankarpaul/post-api-fastify-mongo
It is a simple api that I built for practicing CURD operations.
https://github.com/iamdipankarpaul/post-api-fastify-mongo
dotenv fastify java mongodb mongodb-atlas mongoose nodejs nodemon pino
Last synced: 2 days ago
JSON representation
It is a simple api that I built for practicing CURD operations.
- Host: GitHub
- URL: https://github.com/iamdipankarpaul/post-api-fastify-mongo
- Owner: iamdipankarpaul
- Created: 2023-10-13T10:24:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-13T10:24:13.000Z (about 1 year ago)
- Last Synced: 2024-11-11T14:10:38.008Z (2 months ago)
- Topics: dotenv, fastify, java, mongodb, mongodb-atlas, mongoose, nodejs, nodemon, pino
- Language: JavaScript
- Homepage:
- Size: 16.6 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 fastify, mongodb_atlas and mongoose
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-fastify-mongoose# go inside the directory
cd posts-api-fastify-mongoose# 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/posts
```## Endpoints
### GET method
```shell
# Get all the posts
localhost:5000/posts# Get a single post
localhost:5000/posts/:postId
```### POST method
```shell
# Add a new post
localhost:5000/posts
```### PATCH method
```shell
# Update a single post
localhost:5000/posts/:postId
```### DELETE method
```shell
# Uelete a single post
localhost:5000/posts/:postId
```## Dependencies
Here are some of the major dependencies I have used in this project:
```json
"dependencies": {
"dotenv": "^16.3.1",
"fastify": "^4.24.0",
"mongoose": "^7.6.1"
},
"devDependencies": {
"nodemon": "^3.0.1",
"pino-pretty": "^10.2.3"
}
```## Author
Dipankar Paul 😊 | Contact me 👉 [email protected]