Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akunna1/api-mongodb-node-express-

Creating an API using MongoDB, Express.js, and Node.js to create a social media post with CRUD operations. The post includes a message and an image upload
https://github.com/akunna1/api-mongodb-node-express-

crud-api database express-js mongodb mongoose multer node-js

Last synced: 17 days ago
JSON representation

Creating an API using MongoDB, Express.js, and Node.js to create a social media post with CRUD operations. The post includes a message and an image upload

Awesome Lists containing this project

README

        

- database: social_media_db
- collection: posts

- npm init -y
- npm install express mongoose multer body-parser

##### MongoDB Schema
- There's no need to create a schema in the MongoDB shell, as the schema is defined using Mongoose in the PostSchema

##### Endpoints
- Create Post (with image): POST /posts (Form-data: message, image)
- Get All Posts: GET /posts
- Get Single Post: GET /posts/:id
- Update Post (with new image): PUT /posts/:id (Form-data: message, image)
- Delete Post: DELETE /posts/:id