✔️ File upload; ✔️ File Download; ✔️ File Remove;
The following tools is used in this project:
Before starting 🏁, you need to have Git and Node installed.
# Clone this project
$ git clone https://github.com/sakibhasancse/file-sharing-server
# Access
$ cd file-sharing-server
:Environment variable setup
#database setup
MONGO_DB_URL=mongodb://localhost:27017/fileStorageApi
MONGO_DB_TEST_URL=mongodb://localhost:27017/testFileStorageApi
#background job setup
FILE_REMOVE_PERIOD = '59 59 23 * * *'
REMOVE_MAX_AGED_FILE_TIME = 1 * 60 * 60 * 1000
MAX_FILE_SIZE=2
#limit each IP to 500 requests per windowMs
REQUEST_TIME = 15 * 60 * 1000
REQUEST_LIMIT = 500
#setup google cloud storage
GCLOUD_PROJECT_ID=
GCLOUD_STORAGE_BUCKET=
GCLOUD_EMAIL_CLIENT=
GCLOUD_PRIVATE_KEY=
:Start project
# Install dependencies
$ yarn
# Run the project
$ yarn start
# The server will initialize in the <http://localhost:3000>
:Test case
# Run test case
$ npm run test
:Using Docker
Install Docker on your machine
#Build your container
$ docker-compose build
#Up your container
$ docker-compose up
#or
$ docker-compose up -d
Made with ❤️ by Sakib Hasan