Skip to content

hi-manshu-kumar/Image-cloud-storage-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-cloud-storage-app

restful api for uploading images

This example shows how we can upload our images from nodejs application to mongodb database.

Install

With npm installed, run

$ npm install

Usage

$ npm start

This will start the application at port 1234

API

METHOD   URL                            HEADERS         DESCRIPTION                                                PARAMETERS
GET      localhost:1234/                                --> returns index.html

GET      localhost:1234/post            x-auth          --> returns all post that was shared to community
POST     localhost:1234/post            x-auth          --> adds new POST with image file and ask for              title, description, imagefile, communityflag
                                                        sharing of image to community tab and returns image url
GET      localhost:1234/post/:id                        --> returns the post having same 'id' in the url 

POST     localhost:1234/user                            --> adds user to the db with email and username and        email, password
                                                        x-auth token in header for authentication
GET      localhost:1234/user/me         x-auth          --> used for authetication of user 
POST     localhost:1234/user/login                      --> returns x-auth token and used for user login form      email, password
DELETE   localhost:1234/user/me/token   x-auth          --> used for logout form and removes JWT token from db 

See Also

License

ISC