WebDirShareAPI is written in node.js using express which helps to download/upload files to the specified directory only
-
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
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
-
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 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]/
-
Get bash shell of the container
docker exec -it <container-id> "bash"
-
Stop Service
docker kill <container-id>
-
remove container
docker rm <container-id>
- Implement Search in API and UI