This is a Node/Express/MongoDB REST API for image gallery. It is the API ONLY.
Open the config/default.json file and add your mongoURI .
npm install
npm run server # Runs on http://localhost:5000
-
Request: Add post and request form-data
-
Headers
Content-type: multipart/form-data
-
Body
{ "post": "", "filename": File, "url": "", "url": "", "title": "", "country": "", "context": "", "creator": "", "date": "", }
-
-
Response: 200 (application/json)
-
Body
{ "posts": "" }
-
-
Request: Get all posts of a specific post
-
Headers
x-auth-token: YOURJWT
-
-
Response: 200 (application/json)
-
Body
{ "post": [] }
-
-
Request: File operations
-
Headers
Content-type: [image/jpeg || image/png]
-
-
Response: 200 (formdata)
-
Body
readstream.pipe(image); ## Post İmage [GET /api/posts/:filename]
-
-
Request: Delete existing post
-
Parameters
- id: 1 (number) - An unique identifier of the post. -filename: postname(string) -Delete image,image's chunks of the post
-
Headers
x-auth-token: post._id
-
-
Response: 200 (application/json)
-
Body
{ "msg": "Post removed" }
-