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

https://github.com/leadstar116/nestjs-calculator-backend-api

Nest.js based calculator back-end api
https://github.com/leadstar116/nestjs-calculator-backend-api

api backend nestjs

Last synced: about 2 months ago
JSON representation

Nest.js based calculator back-end api

Awesome Lists containing this project

README

          

NestJS Caculator Backend API

## Description
Implemented the calculator backend API in the simplest way with Nest.js.

The API only has one endpoint, POST /calculate.

Body contains
- next: (string) the next number to be operated on with the total
- total: (string) the running total
- operation: (string) +, -, etc.

### Live Demo
https://nestjs-calculator-backend-api.herokuapp.com/api

## Installation

```bash
$ yarn install
```
### Environment configuration
Copy `.env.example -> .env`.

```bash
$ yarn migration:run
```

## Running the app

```bash
# start
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod
```

Open browser and visit `localhost:3001/api`.

## Test

```bash
# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov
```