Complete CRUD app with MongoDB and Expressjs
Make sure to install the dependencies:
# yarn
yarn install
# npm
npm install
Create a .env
file and add the following variables:
DB_URL= # Database URL
Start the development server on http://localhost:3001
# yarn
yarn dev
# npm
npm run dev
GET /posts/ # Get all post with pagination
GET /posts/:id # GEt Single post
POST /posts/ # Add post
PATCH /posts/ # Update one post
DELETE /posts/ # Delete one post