Skip to content

Latest commit

 

History

History
122 lines (102 loc) · 1.83 KB

File metadata and controls

122 lines (102 loc) · 1.83 KB

Planticure API

Backend API for Planticure app.

Installation

1. Install using NPM

npm install
npm install --save-dev

2. Put .env file download .env file here
.env file
then place it on base directory (make sure the file named '.env').
image

How to run

npm run start

Endpoints

https://localhost:8080

Register

  • URL

    • /register
  • Method

    • POST
  • Request Body

    • name : string
    • email : string, must be unique
    • password : string, must be at least 6 characters
  • Response

    {
      "error" : false,
      "message": "User register success",
      "uid" : " ax1231zx...... "
    }

Login

  • URL

    • /login
  • Method

    • POST
  • Request Body

    • email : string
    • password : string
  • Response

    {
      "error" : false,
      "message": "Successfully logged in.",
    }

Get All Plants

  • URL

    • /plants
  • Method

    • GET
  • Response

    {
      "error" : false,
      "message": "Plants fetched successfully"
      "data" : [
        {
          ...
        }
      ]
    }

Get Plant by Name

  • URL

    • /plant/{name}
  • Method

    • GET
  • Response

    {
      "error" : false,
      "message": "Plants fetched successfully"
      "data" : [
        {
          ...
        }
      ]
    }

Get Disease by Plant

  • URL

    • /plant/{name}/disease
  • Method

    • GET
  • Response

    {
      "error" : false,
      "message": "Plants fetched successfully"
      "data" : [
        {
          ...
        }
      ]
    }