DataTable is a simple web-based datatable that supports pagination, sorting, search, and a selectable number of entries in the table. This repository is the back-end (Node.js and MySQL) for the DataTable Application.
Clone the repository and use Node.js and package manager npm to install and start the DataTable server.
cd assignment-datatable-backend\
npm install
node server.js
The server should be up and running at http://localhost:8080/.
The database used for this application is MySQL. There is no configuration required for the database as it is already configured and hosted in AWS Relational Database Service (RDS).
- GET -
/api/countries/
- Fetches the count of the countries from the database. - GET -
/api/countries/:limit-:offset/:sortBy-:orderBy
- Fetches the countries based on limit, offset, sorting and ordering params.
- express - Building APIs
- mysql2 - MySQL Database Driver
- cors - Cross-Origin Resource Sharing
- dotenv - Loads environment variables from .env file
- The versions of Node.js and npm for development are v16.16.0 and 8.11.0 respectively. For other dependency versions, please refer package.json file.
- The .env file is GIT ignored in this repository, I will share it personally if required.