Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

helps to download/upload files to the specified directory only

License

Notifications You must be signed in to change notification settings

dmdhrumilmistry/WebDirShareAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebDirShareAPI

WebDirShareAPI is written in node.js using express which helps to download/upload files to the specified directory only

Installation

  • Clone/Download repository

    git clone --depth=1 https://github.com/dmdhrumilmistry/WebDirShareAPI/
  • Change Directory

    cd WebDirShareAPI
  • Install dependencies

    npm install
  • Create .env file containing API configuration

    SHARE_DIR=ShareDirectoryPATH # set directory path
    PORT=3000 # set api port
  • Start API

    npm run app

Endpoints

Endpoint Method Description POST Method Form Body
/api/get/dirPath GET Get files and directories of specific directory in shared directory -
/api/download/filePath GET Download specific File -
/api/upload POST Upload file to a specfic location location, file

Note: dirPath, filePath and location should be complete path within the shared directory in base64 format

Dockerize Project

Build

  • using docker build project

    docker build . -t <app-name>
  • Start Application

    docker run -p <localport>:<container-port> -d <app-name>
    # outputs container id
    <container-id>

    Default container port : 80
    Application can be acccessed from http://127.0.0.1:[local-port]/

Pull Docker Image

  • Pull Image

    docker pull dmdhrumilmistry/webdirshare
  • Start Application

    docker run -p <localport>:80 -d <app-name>
    # outputs container id
    <container-id>

    Application can be acccessed from http://127.0.0.1:[local-port]/

Managing Files manually

  • Get bash shell of the container

    docker  exec -it <container-id> "bash"

Stop and Delete Container Data

  • Stop Service

    docker kill <container-id>
  • remove container

    docker rm <container-id>

TODO

  • Implement Search in API and UI