Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 2.04 KB

README.md

File metadata and controls

55 lines (42 loc) · 2.04 KB

Rent A Car Fake Backend

Fake Backend service of Rent A Car project for frontend tutorials.

⚙️ Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repository:
    git clone https://github.com/ahmet-cetinkaya-instruction/rent-a-car-fake-backend.git
  2. Change your directory in the terminal:
    cd rent-a-car-fake-backend
  3. Install the required packages:
    npm install
  4. Copy the .env.example file and rename it to .env.
  5. Edit the .env file and set the value of the JWT_SECRET_KEY property to a random string of your choice.

🚀 Usage

Start project

npm start

🔀 Routes

Route Comment Body Header Return
auth/login Login process to authenticate users {userName: string, password: string} {success:boolean, access_token:string}
auth/test Test the validity of your access token Authorization: "Bearer <access_token>" {success:boolean, message:string}
auth/test-admin Test if your access token has admin role Authorization: "Bearer <access_token>" {success:boolean, message:string}