Version 1.0.0
S3 file uploader API built with Nodejs.
Note: JavaScript ES5 is used for this application.
-
Express is a lightweight backend microservices framework.
-
Sequalizer is the database ORM used handle to build db schema and interact with mysql database server.
- Local or remote instance of MySQL running.
Follow instructions to install the node on your machine Node docs.
Navigate to your project folder on local machine and execute the following command from your terminal to clone the repository into your current directory locally.
git clone https://github.com/ahmedmeshref/file-uploader-api.git
From your terminal, install all dependencies needed by executing npm install
.
-
Create .env file in the main project directory to store all environment variables needed. If you are using linux, execute
touch .env
from your terminal. -
Copy and update the values of the following variables to your .env file.
DATABASE_HOST={db_host}
DATABASE={db_name}
DB_USERNAME={db_username}
DB_PASSWORD={db_password}
PORT={application_port}
AWS_BUCKET_NAME={s3_bucket_name}
AWS_ACCESS_ID={aws_access_id}
AWS_SECRET_ACCESS_KEY={aws_access_key}
Example: DATABASE_HOST=localhost
To run the server, from your terminal execute:
npm start
Interact with the api via postman. The default URI is http://{your_url}:{port_number}/api/v1/your-route eg: http://localhost:8080/api/v1/upload