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
- Host: GitHub
- URL: https://github.com/leadstar116/nestjs-calculator-backend-api
- Owner: leadstar116
- Created: 2020-09-29T04:39:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T04:57:44.000Z (almost 6 years ago)
- Last Synced: 2025-03-21T11:32:13.338Z (over 1 year ago)
- Topics: api, backend, nestjs
- Language: TypeScript
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```