manage-accounts-service/api/README.md
2023-08-13 11:51:54 +03:00

1.5 KiB

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

  1. Clone this repository to your local machine:

    git clone https://github.com/yourusername/dario-api.git
    
    
  2. 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"
}