This API allows you to create blog posts, update blog posts, delete blog posts and get all blog posts. It also includes a pagination feature that allows you to get a specific number of posts per page.
This API was developed with the following technologies:
- NodeJS
- Fastify
- Typescript
- PostgreSQL
- TypeORM
- Prisma
Pre-requisites
- Node(LTS version)
- NPM v9.0.0 or higher
- PostgreSQL
You can get the latest version of NodeJS from here or you can check the version you have installed on your machine by running the following command in your terminal
node -v
You can get the latest version of NPM from here or you can check the version you have installed on your machine by running the following command in your terminal
npm -v
You can get the latest version of PostgreSQL from here or you can check the version you have installed on your machine by running the following command in your terminal
psql -V
Clone the project
git clone git@github.com:vicodevv/Blog-API.git
Go to the project directory
cd Blog-API
Install dependencies
npm install
Run the code
npm run dev
To run tests, run the following command
npm run test
https://documenter.getpostman.com/view/17026180/2s9YC7UC7K
To run this project, you will need to add the following environment variables to your .env file
- DATABASE_URL=your database url
Method | Description | Endpoints |
---|---|---|
GET | Get all blog posts | /all |
GET | Get a single blog post | /:id |
POST | Create a blog post | /create |
PUT | Update a blog post | /update/:id |
DELETE | Delete a blog post | /delete/:id |