Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tutods/nlw06-node
Project developed on NLW#06 of NodeJS
https://github.com/tutods/nlw06-node
eslint express node nodejs nodemon prettier typescript
Last synced: 9 days ago
JSON representation
Project developed on NLW#06 of NodeJS
- Host: GitHub
- URL: https://github.com/tutods/nlw06-node
- Owner: tutods
- Created: 2021-06-21T08:56:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T01:23:59.000Z (6 months ago)
- Last Synced: 2024-05-06T02:33:50.590Z (6 months ago)
- Topics: eslint, express, node, nodejs, nodemon, prettier, typescript
- Language: TypeScript
- Homepage:
- Size: 377 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NLW#06 NodeJS
This project is created from the NLW#06 of NodeJS
📋 How to execute:
To run this project follow commands below:
1. `yarn install`;
2. `yarn typeorm migration:run`;
3. `yarn dev`: this run the development server;
💬 Changes:
- I use **Nodemon** with **TS-Node** instead **TS-Node-Dev**;
- Add **ESLint** configuration (`.eslintrc`) and add hook to run on `git push`;
- Custom folder structure;
- Use one controller for all **CRUD** services (`getAll`, `getOne`, `create`, `update` and `delete`);
- Use **JOI** to validate parameters and body of requests;
- I create 3 middlewares to validade the body, query parameters or url parameters;
- Set **Babel** to build;
- Use `classToClass` (form `class-transformer` package) to hide password on result of requests;
How to fix Husky to run hooks:
In `package.json` add on scripts:
```json
"postinstall": "husky install",
```After that run on your terminal:
- **With Yarn:**
- `yarn husky add .husky/pre-push "yarn lint"`
- `yarn husky add .husky/pre-commit "yarn lint-staged"`
- **With NPM:**
- `npx husky add .husky/pre-push "npm run lint`
- `npx husky add .husky/pre-commit "npm lint-staged`