Simple file management API that allows users to:
- Upload files
- Retrieve information about the files
- Download the files
- Share uploaded files with other users
Clone the repo
git clone https://github.com/ngugimuchangi/alx-files_manager.git
Install required dependencies
cd alx-files_manager
npm install
Start worker
npm run start-worker
Start express server
npm run start-server
Environment variables you can adjust when running the express server
PORT
: express server's portDB_HOST
: mongodb's server host addressDB_PORT
: mongodb's portDB_DATABASE
: database to useFOLDER_PATH
: absolute path to folder to store files
The API's documentation is available at here
Specify different DB_DATABASE
and FOLDER_PATH
environment when running test
to avoid data loss in main database and folder. Check out test folder
for unit tests.
- Run specific test
DB_DATABASE='test_database' FOLDER_PATH='/tmp/test_folder' npm test tests/testFile.js
- Run all tests
DB_DATABASE='test_database' FOLDER_PATH='/tmp/test_folder' npm run test-all