https://github.com/madeindjs/nestjs-poc
https://github.com/madeindjs/nestjs-poc
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/madeindjs/nestjs-poc
- Owner: madeindjs
- Archived: true
- Created: 2021-08-23T15:28:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T12:18:37.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T21:41:47.104Z (over 1 year ago)
- Language: TypeScript
- Size: 191 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nest.js POC
[](https://github.com/madeindjs/nestjs-poc/actions/workflows/main.yml)
My personnal tests for [Nest](https://github.com/nestjs/nest).
## Installation
```bash
$ npm install
```
## Running the app
```bash
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
```
## Usage
```sh
# Create user
curl -X POST -d email=test@test.fr -d password=123456 localhost:3000/users
# Get token
curl -X POST -d email=test@test.fr -d password=123456 localhost:3000/auth
# Use token
export TKN="eyJhbGciOiJ...X4"
curl -H "Authorization: Bearer $TKN" localhost:3000/users/1
curl -X PATCH -H "Authorization: Bearer $TKN" -d password=654321 localhost:3000/users/1
# reset password
curl -X POST -d email=test@test.fr localhost:3000/password-reset
curl -X PATCH -d password=azerty localhost:3000/password-reset/1b0859ff-5fb6-4cbc-8c22-4902da3a0b20 # token extracted from server log
curl -X POST -d email=test@test.fr -d password=azerty localhost:3000/auth
# add credit to use API
curl -X POST -H "Authorization: Bearer $TKN" localhost:3000/credits
# create website
curl -H "Authorization: Bearer $TKN" -d url=www.2244.fr localhost:3000/websites
```
## Test
```bash
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
```
## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## Stay in touch
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
## License
Nest is [MIT licensed](LICENSE).