/replate-be

Primary LanguageJavaScriptMIT LicenseMIT

Back-end - Replate2

Back-end repo for replate2 deployed Link is:

Business

Logs a Business User In

Logs a Business User In

POST /api/businesses/login

Parameters

Name Type Description
username String

Username of the User

password String

Password of the User

Success Response

Success-Response:

[ { "username": "nick", "name": null, "address": null, "phone": null, "email": null } ]

{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0IjoxLCJ1c2VybmFtZSI6Im5pY2siLCJyb2xlIjoiZG9uYXRvciIsImlhdCI6MTU4MDg2ODI4MSwiZXhwIjoxNTgxNDczMDgxfQ.Rxg7V9AsxWXXxGtpSQONvrTRwYrNm1H7-d7UosgC8bE", "message": "Welcome nick!" }

Error Response

Invalid--credentials-please-try-again

{ message: "Invalid credentials, please try again."}

Registers a New Business User

Registers a New Volunteer

POST /api/businesses/register

Parameters

Name Type Description
username String

The New Business Users username *Required

password String

The New Business Users password *Required

name String

The New Business Users name

address String

The New Business Users address

phone String

The Users Business phone

email String

The New Business Users email

Success Response

Success-Response:

{ "username": "nick", "name": null, "address": null, "phone": null, "email": null }

Auth

Logs an Volunteer In

Logs an Volunteer In

POST /api/volunteers/login

Parameters

Name Type Description
username String

Username of the User

password String

Password of the User

Success Response

Success-Response:

{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0IjoxLCJ1c2VybmFtZSI6Im5pY2siLCJyb2xlIjoidm9sdW50ZWVyIiwiaWF0IjoxNTgwODY4OTYzLCJleHAiOjE1ODE0NzM3NjN9.y6u3ZD1wCc_6MhpCDXVNRElpQYEpHeLHA-hvtriJoRQ", "message": "Welcome nick!" }

Error Response

Invalid--credentials-please-try-again

{ message: "Invalid credentials, please try again."}

Registers a New User

Registers a New Volunteer User

POST //api/volunteers/register

Parameters

Name Type Description
username String

The New Business Users username *Required

password String

The New Business Users password *Required

name String

The New Business Users name

phone String

The Users Business phone

Success Response

Success-Response:

{ "name": null, "phone": null }