Skip to content

Files

Latest commit

5e1272a · Jan 27, 2022

History

History

nest-file-uploading

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 26, 2019
Jul 24, 2019
Nov 11, 2019
Jul 25, 2019
Jul 24, 2019
Nov 11, 2019
May 2, 2021
Jan 27, 2022
Jul 24, 2019
Jul 24, 2019
Jul 24, 2019
Jan 27, 2022
Jan 27, 2022
Jul 24, 2019
Jul 24, 2019
Jul 24, 2019

Nestjs file uploading

Nestjs file uploading example demonstrating how to upload single and multiple files over an HTTP endpoint. For an in-depth explanation of the application and the basic Nestjs concepts, you can follow this article.

Requirements

Getting started

Installing dependencies

First, you need to install all the needed dependencies.

$ npm install

Starting the application

After installing the dependencies, you can run the application using one of the following commands.

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Sending HTTP request

Once the server has started successfully, you can start sending HTTP requests to the three endpoints:

  • GET request - localhost:3000/:imgpath - Get an uploaded image
  • POST request - localhost:3000 - Upload a single image
  • POST request - localhost:3000/multiple - Upload multiple images at a time