.. | ||
src | ||
.env.example | ||
package-lock.json | ||
package.json | ||
README.md | ||
request.http | ||
tsconfig.json |
Dario API
The Dario API is a RESTful API built using Express.js, MongoDB, and Redis, designed to provide endpoints for user eligibility verification and registration.
Table of Contents
Getting Started
Prerequisites
Before running the Dario API, ensure you have the following installed on your system:
- Node.js (v14 or higher)
- MongoDB
- Redis Server
Installation
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/dario-api.git
-
Install the required npm packages:
cd api
npm install
Configuration
Create a .env file in the root directory of the project with the variables listed in .env.example.
Usage
npm run dev
Endpoints
POST /verify-eligibility
Verify user eligibility based on a provided key. Example Request:
POST http://localhost:3000/verify-eligibility
Content-Type: application/json
{
"key": "your_user_key"
}
POST /register
Register a user after verifying eligibility. Example Request:
POST http://localhost:3000/register
Content-Type: application/json
{
"email": "johndoe@example.com",
"key": "your_user_key",
"name": "John Doe",
"phone": "123-456-7890"
}