This Rest API is built with Node.js, Express, Prisma ORM, and PostgresQL. It provides CRUD functionality for a simple quotes application. Users can create, read, update, and delete quotes, as well as create and read authors and users.
Before running this Rest API, you need to have the following installed on your machine:
- Node.js
- PostgresQL
- Clone this repository to your local machine
- Navigate to the cloned directory
- Run
npm install
to install all the necessary dependencies - Create a
.env
file in the root directory of the project and set the following environment variables:- DATABASE_URL: URL to your PostgresQL database
- PORT: Port number for the server to run on
- Run
npx prisma migrate dev
to apply the database schema to your database - Run
npm start
to start the server
This Rest API has the following endpoints:
GET
: Get all authorsPOST
: Create a new author
GET
: Get a specific authorPUT
: Update a specific authorDELETE
: Delete a specific author
GET
: Get all quotesPOST
: Create a new quote
GET
: Get a specific quotePUT
: Update a specific quoteDELETE
: Delete a specific quote
GET
: Get all users
POST
: Create a new user
POST
: login user
GET
: Get a specific userPUT
: Update a specific userDELETE
: Delete a specific user