/Rest-Api

NodeJS application integrated with google drive with the following REST APIs

Primary LanguageTypeScript

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

Working of the Code

  1. For listing of all the files, just write this in POST request

image

Our O/P will be like above, if we specify the "id" of our folder as input to our POST request in the form of json like this, then it will show all the file of that particular folder .

image

!! we got the ID of folder or any file using the search POST request like this, so we can use that anywhere.

  1. Using the search, by giving the file_name in POST request in the form of json like this

image

It is showing two file name which have same name and they are in two different places.

  1. We can also generate webviewlink/webcontentlink by passing the id to our POST request in the form of json like this, so it will give o/p like this

image

  1. For creating the folder , we just need to give the name_of_our_folder to our POST request in the form of json like this

image

our folder will look like this in our drive

image

  1. for saving the file in our drive, we need to do this like this

image

here we specify four things -->

"file_name":"the name through which we want to save the file on our drive",
"file_actual_name":"the actual name of file which is in our local device with extension ",
"file_MIME_Type":"MIME type of our file ",
"folder_id":"ID of our folder , if we don't specify it then it will save the file in our root drive not inside the folder ",

Our file will look like this in our folder this_is_our_eazydiner in folder like this

image

Just focus on the POST request URL and the parameters that we are passing to our request and in which format and their variables name also .

Thank You