-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: FREDVUNI <[email protected]>
- Loading branch information
Showing
1 changed file
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,52 @@ | ||
# prisma node restAPI | ||
# Prisma Node JS Express RESTAPI | ||
|
||
Rest API in Node , Express app server using prisma ORM and postgresQL | ||
## Overview | ||
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. | ||
|
||
## Prerequisites | ||
Before running this Rest API, you need to have the following installed on your machine: | ||
- Node.js | ||
- PostgresQL | ||
|
||
## Installation | ||
1. Clone this repository to your local machine | ||
2. Navigate to the cloned directory | ||
3. Run `npm install` to install all the necessary dependencies | ||
4. 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 | ||
5. Run `npx prisma migrate dev` to apply the database schema to your database | ||
6. Run `npm run dev` to start the server | ||
|
||
## Endpoints | ||
This Rest API has the following endpoints: | ||
|
||
### `/authors` | ||
- `GET`: Get all authors | ||
- `POST`: Create a new author | ||
|
||
### `/authors/:id` | ||
- `GET`: Get a specific author | ||
- `PUT`: Update a specific author | ||
- `DELETE`: Delete a specific author | ||
|
||
### `/quotes` | ||
- `GET`: Get all quotes | ||
- `POST`: Create a new quote | ||
|
||
### `/quotes/:id` | ||
- `GET`: Get a specific quote | ||
- `PUT`: Update a specific quote | ||
- `DELETE`: Delete a specific quote | ||
|
||
### `/users` | ||
- `GET`: Get all users | ||
- `POST`: Create a new user | ||
|
||
### `/users/:id` | ||
- `GET`: Get a specific user | ||
- `PUT`: Update a specific user | ||
- `DELETE`: Delete a specific user | ||
|
||
## Conclusion | ||
That's it! You should now have a working Rest API in Node, Express app server using Prisma ORM and PostgresQL. Feel free to modify the code to suit your needs. |