项目作者: TheRavi

项目描述 :
Node.js: Download file from server
高级语言: JavaScript
项目地址: git://github.com/TheRavi/download-file-from-server.git
创建时间: 2021-05-01T19:54:46Z
项目社区:https://github.com/TheRavi/download-file-from-server

开源协议:

下载


Node.js: Download file from server

This is a Rest API which downloads a given file (if exists) from a given directory (configured in .env).

Badges

Quality Gate Status

API Reference

Get Status and Version

  1. GET /

Get file from server

  1. GET /filedownload/${filename}
Parameter Type Description
filename string Required. file name to download

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DOWNLOAD_DIRECTORY

Run Locally

Clone the project

  1. git clone https://github.com/TheRavi/download-file-from-server

Go to the project directory

  1. cd download-file-from-server

Install dependencies

  1. npm install

Start the server

  1. npm start

Running Tests

To run tests, run the following command

  1. npm run test

To open Cypress and run tests, run the following command

  1. npm run cypress:open

To see coverage report, run the following command

  1. npx nyc report

Authors