Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanokpit-yowaratch/nestjs-mysql-blog

Blog API by NestJS
https://github.com/kanokpit-yowaratch/nestjs-mysql-blog

dotenv eslint express jest multer mysql2 nestjs nestjs-mysql swagger swagger-ui-express typeorm typescript

Last synced: about 1 month ago
JSON representation

Blog API by NestJS

Awesome Lists containing this project

README

        


Nest Logo
Express Logo

TypeScript Logo

## nestjs-mysql-blog

This is a blog's `api` application created by NestJS

## Tech Stack

`NestJS` `Express` `TypeScript`

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## PM2 command

```bash
# build to create dist/main.js
$ npm run build

# pm2 to start api service
$ pm2 start dist/main.js --name "nestjs-api"
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Configuration file
**`.env`** file as follows:


  • API_PORT=[avoid 5000]

  • DB_HOST=localhost

  • DB_PORT=3306

  • DB_USERNAME=

  • DB_PASSWORD=

  • DB_DATABASE=

## Demo

[kanokpit.com](https://kanokpit.com)

## Client example

Client blog repo: [nextjs-client-blog](https://github.com/kanokpit-yowaratch/nextjs-client-blog)