This repo helps you to get started with ExpressJs, MongoDB, NodeJs and Typescript in docker Environment.
Commands
# clone github repo
$ git clone https://github.com/bhimrazy/express-blog-api
$ cd express-blog-api
$ cp .env.example .env
# Run without using docker
# SET DATABASE_URL
$ npm install
$ npm run dev
# Run with docker
# start containers
$ docker-compose up -d
# start containers
$ docker-compose up -d
# stop containers
$ docker-compose down
# check logs of docker image
$ docker logs <CONTAINER_ID>
# Run tests
$ npm run test
.
├── dist/ # Build files
├── public/ # Contains static files
├── src/ # All
│ ├── configs/ # Contains all the configurations
│ ├── models/ # Contains all the database schema and models
│ ├── services/ # Contains all the services
│ ├── controllers/ # Contains all the controllers
│ ├── middlewares/ # Contains all the middlewares
│ ├── validators/ # Contains all the request validators
│ ├── serializers/ # Contains all the serializers
│ └── routes/ # Contains all the routes
├── tests/ # Contains all the test files
├── tsconfig.json # Typescript Config
├── index.ts # Index file
├── package.json
├── package-lock.json
└── README.md
Postman Docs: https://documenter.getpostman.com/view/8091590/2s8YRnmXTd
GET /api/v1/
POST /api/v1/register
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Your Name |
email |
string |
Required. Your Email |
password |
string |
Required. Your Password |
POST /api/v1/login
Parameter | Type | Description |
---|---|---|
email |
string |
Required. Your Email |
password |
string |
Required. Your Password |
GET /api/v1/blogs/
GET /api/v1/blogs/:id
POST /api/v1/blogs/
PUT /api/v1/blogs/:id
DELETE /api/v1/blogs/:id