
1. Serviço de inicialização
1.1. PM2
1.2. Nodemon
2. Json
2.1. BodyParse
3. API
3.1. Serviço de API
3.1.1. Node Resful
4. Logs
4.1. Escrever log no cloudwatch
4.2. pinojs/pino
5. ES6
5.1. Módulos
5.1.1. Compilador
5.1.1.1. Sucrase
5.1.1.2. Babel
6. YUP
6.1. Validação com número e null
6.1.1. yup.number().nullable() does not allow `null` value · Issue #500 · jquense/yup
7. Typescript
7.1. Typeorm
7.1.1. erros
7.1.1.1. has no initializer and is not definitely assigned in the constructor.
7.1.1.1.1. Try adding "strictPropertyInitialization": false to your compiler options.
7.1.2. ENUM
7.1.2.1. https://stackoverflow.com/a/45153609/821826
7.1.3. where in
7.1.3.1. [Question] How to query IN Array with Typeorm's repository API? · Issue #1239 · typeorm/typeorm
7.1.4. One to One
7.1.4.1. typeorm/typeorm
7.1.5. Relation inside relation
7.1.5.1. [Question] Is it possible to include Nth-level relationship data using find options? · Issue #1270 · typeorm/typeorm
7.2. Error letra maíscula - only in casing
7.2.1. "forceConsistentCasingInFileNames": false, in tsconfig.json
7.3. Buscar dentro do enum
7.4. If com enum
7.4.1. if (faqType in faqTypesEnum) {
7.5. Type of
7.6. QueryBuilder
7.6.1. Query Builder - Select using Query Builder - 《TypeORM v0.2.20 Document》 - 书栈网 · BookStack
7.6.2. Order By
7.6.2.1. query = query.orderBy('questions.name', 'ASC');
7.7. Where
7.7.1. Json Array
7.7.1.1. 'services.animal_types::jsonb @> \'["' + animal_type + '"]\'::jsonb',
7.8. Erros
7.8.1. Looks like this entity is not registered in current "default" connection?
7.8.1.1. Error: RepositoryNotFoundError: No repository for [Enitity] was found. Looks like this entity is not registered in current "default" connection? · Issue #3017 · typeorm/typeorm
8. Joi Celebrate Validação
8.1. Enum
8.1.1. import UserTypesEnum from '@shared/enums/userTypes'; preUserRouter.post( '/', celebrate({ [Segments.BODY]: { user_type: Joi.string() .valid(UserTypesEnum.MEMBER, UserTypesEnum.CUSTOMER, UserTypesEnum.ONG) .required(),
8.2. Validação condicional
8.2.1. Conditional rule based on value of another key · Issue #194 · hapijs/joi
8.2.2. Joi.object({ guest_user_id: Joi.string(), user_id: Joi.any().when('guest_user_id', { is: Joi.exist(), then: Joi.string().uuid(), otherwise: Joi.string().uuid().required() }) })
8.3. Validando a data minima de 18 anos
8.3.1. Question: Validate Age · Issue #1268 · hapijs/joi
8.4. Array Validate
8.4.1. service_types: Joi.array() .items( Joi.string() .valid(ServiceTypesEnum.FACE_TO_FACE, ServiceTypesEnum.REMOTE) .required(), ) .required(),
8.4.2. Joi — awesome code validation for Node.js and Express
8.5. Teste
8.5.1. hapi.dev
8.6. Documentation
8.6.1. sideway/joi
9. Teste Unitário
9.1. Problemas
9.1.1. Timeout
10. ORM
10.1. Sequelize
10.1.1. Update uma coluna
10.1.2. Operators
10.1.2.1. Manual | Sequelize
10.1.3. Raw
10.1.3.1. Sequelize query is giving TypeError: undefined is not a function
10.1.4. Timeout
10.1.4.1. Increase
10.1.5. Order By
10.1.5.1. Ordenar por outra model que esteja associada
11. Cors
11.1. Habilitar
12. Express
12.1. Query
12.1.1. Convert em números os dados que são enviados via query request
12.1.1.1. express-query-int
12.2. Formas de obter dados
12.2.1. Query Params: ?teste=1
12.2.1.1. const {nome} = req.query;
12.2.2. Route params: /users/1
12.2.2.1. /users/:id const {id} = req.params;
12.2.3. Request Body: {"name": "jay"}
12.2.3.1. const {name} = req.body;
12.3. Habilita o Express a aceitar json na requisição
12.3.1. server.use(express.json());
13. Scaffods
13.1. The web's scaffolding tool for modern webapps | Yeoman
14. NODE_ENV
14.1. erros
14.1.1. NODE_ENV’ não é reconhecido como um comando interno ou externo, um programa operável ou um arquivo em lotes
15. Yarn
15.1. comandos --save ou --save-dev
15.1.1. Se você está acostumado ao npm, você pode estar esperando usar --save ou --save-dev. Esses comandos foram substituídos por yarn add e yarn add --dev. Para mais informações, veja a documentação do yarn add.