Skip to content

Commit

Permalink
fix: &rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Russo committed Mar 14, 2022
1 parent d0fbc67 commit 4a99cfa
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DebugerDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY src /app
COPY package.json /app
COPY ecosystem.config.js /app

RUN apt updateRep && apt install jq original-awk -y
RUN apt update && apt install jq original-awk -y
RUN npm install pm2 -g && npm install --global yarn cross-env --force
RUN chown -R node:node /app

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Hello! **NExp** *(Node Experience)* is a boilerplate for [**Node**](https://node
Each module is divided by business domain:

- App
- AuthHelper
- Auth
- File
- Item
- Notification
Expand Down
8 changes: 2 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,19 @@ module.exports = {
coveragePathIgnorePatterns: [
"<rootDir>/node_modules/",
"<rootDir>/.eslintrc.js",
"<rootDir>/src/app.ts",
"<rootDir>/src/Logger.ts",
"<rootDir>/src/command.ts",
"<rootDir>/src/File/*",
"<rootDir>/src/AppExpress/Domain/*",
"<rootDir>/src/Infrastructure/Notifications/*",
"<rootDir>/src/User/Presentation/Commands/*",
"<rootDir>/src/Item/Presentation/Commands/*",
"<rootDir>/src/Role/Presentation/Commands/*",
"<rootDir>/src/AppExpress/Presentation/Criterias/NotificationFilter.ts",
"<rootDir>/src/AppExpress/Presentation/Criterias/NotificationSort.ts",
"<rootDir>/src/AppExpress/Presentation/Criterias/*",
"<rootDir>/src/File/Infrastructure/Repositories/FileSqlRepository.ts",
"<rootDir>/src/User/Infrastructure/Repositories/UserSqlRepository.ts",
"<rootDir>/src/Role/Infrastructure/Repositories/RoleSqlRepository.ts",
"<rootDir>/src/Item/Infrastructure/Repositories/ItemSqlRepository.ts",
"<rootDir>/src/AuthHelper/Infrastructure/Repositories/TokenRedisRepository.ts",
"<rootDir>/src/AppExpress/Domain/UseCases/GetLogViewUseCase.ts",
"<rootDir>/src/Auth/Infrastructure/Repositories/TokenRedisRepository.ts"
],

// Indicates which provider should be used to instrument code for coverage
Expand Down
5 changes: 2 additions & 3 deletions src/App/Presentation/Shared/Express/AppExpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import compression from 'compression';
import cors from 'cors';
import helmet from 'helmet';
import exphbs from 'express-handlebars';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pinoExpress = require('pino-express');

import '../../Handlers/Express/IndexHandler';
import '../../../../Item/Presentation/Handlers/Express/ItemHandler';
Expand All @@ -29,6 +27,7 @@ import Logger from '../../../../Shared/Logger/Logger';
import MainConfig from '../../../../Config/mainConfig';
import { RequestContext } from '@mikro-orm/core';
import { orm } from '../../../../Shared/Database/MikroORMCreateConnection';
import LoggerMiddleware from '../../Middlewares/Express/LoggerMiddleware';

class AppExpress implements IApp
{
Expand Down Expand Up @@ -78,7 +77,7 @@ class AppExpress implements IApp
});
}

app.use(pinoExpress(Logger));
app.use(LoggerMiddleware);
app.use('/api/', Throttle);
app.use(AuthenticationMiddleware);
app.use(VerifyTokenMiddleware);
Expand Down
2 changes: 1 addition & 1 deletion src/App/Presentation/Shared/Express/ErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ErrorHandler

if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test')
{
Logger.debug(err.stack);
Logger.trace(err.stack);
}

responder.error(formatError.getFormat(exception), req, res, exception.statusCode, exception.metadata);
Expand Down
5 changes: 2 additions & 3 deletions src/App/Presentation/Shared/Koa/AppKoa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import MainConfig from '../../../../Config/mainConfig';
import { RequestContext } from '@mikro-orm/core';
import { orm } from '../../../../Shared/Database/MikroORMCreateConnection';
import LoggerMiddleware from '../../Middlewares/Koa/LoggerMiddleware';
import { Logger } from 'tslog';
import Logger from '../../../../Shared/Logger/Logger';

class AppKoa implements IApp
{
Expand Down Expand Up @@ -105,8 +105,7 @@ class AppKoa implements IApp
{
return this.app.listen(this.port, () =>
{
const log: Logger = new Logger();
log.info(`Koa is listening to http://localhost:${this.port}`);
Logger.info(`Koa is listening to http://localhost:${this.port}`);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/File/Domain/UseCases/GetFileMetadataUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetFileMetadataUserCase

async handle(payload: IdPayload): Promise<IFileDomain>
{
const id = payload.id;
const { id } = payload;
return await this.fileService.getOne(id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/File/Domain/UseCases/RemoveFileUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RemoveFileUseCase

async handle(payload: IdPayload): Promise<IFileDomain>
{
const id = payload.id;
const { id } = payload;
return this.fileService.removeFile(id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/File/Domain/UseCases/UpdateFileBase64UseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateFileBase64UseCase

async handle(payload: FileUpdateBase64Payload): Promise<any>
{
const id = payload.id;
const { id } = payload;
let file: IFileDomain = await this.fileService.getOne(id);
file = await this.fileService.persist(file, payload);
return await this.fileService.uploadFileBase64(file, payload);
Expand Down
2 changes: 1 addition & 1 deletion src/File/Domain/UseCases/UpdateFileMultipartUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateFileMultipartUseCase

async handle(payload: FileUpdateMultipartPayload): Promise<any>
{
const id = payload.id;
const { id } = payload;
let file: IFileDomain = await this.fileService.getOne(id);
file = await this.fileService.persist(file, payload);
return await this.fileService.uploadFileMultipart(file, payload);
Expand Down
2 changes: 1 addition & 1 deletion src/Item/Domain/UseCases/RemoveItemUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class RemoveItemUseCase

async handle(payload: IdPayload): Promise<IItemDomain>
{
const id = payload.id;
const { id } = payload;
return await this.repository.delete(id);
}
}
Expand Down

0 comments on commit 4a99cfa

Please sign in to comment.