Skip to content

Финальный отсчёт - #12

Merged
keksobot merged 17 commits into
htmlacademy-nodejs-api:masterfrom
Adonariz:module9-task1
May 19, 2026
Merged

keksobot merged 17 commits into
htmlacademy-nodejs-api:masterfrom
Adonariz:module9-task1

Conversation

@Adonariz

@Adonariz Adonariz commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

@keksobot keksobot changed the title Module9 task1 Финальный отсчёт May 15, 2026
Comment thread src/rest/rest.application.ts Outdated
this.server.use(
authenticateMiddleware.execute.bind(authenticateMiddleware),
);
this.server.use(cors());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cors нужно выше вещать, чуть ли не самым первым

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поднял

Comment on lines +19 to +31
const storage = diskStorage({
destination: this.uploadDirectory,
filename: (_req, file, callback) => {
const fileExtention = extension(file.mimetype);
const filename = nanoid();
callback(null, `${filename}.${fileExtention}`);
},
});

const uploadFilesMiddleware = multer({ storage }).array(
this.fieldName,
this.maxCount,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправь если не прав, но я не вижу валидацию максимального размера файла, такое даже если нет в ТЗ, лучше добавить, чтобы не загрузили огромный файл

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавил валидацию

Comment thread src/rest/rest.constant.ts Outdated
Comment on lines +1 to +2
export const STATIC_UPLOAD_ROUTE = '/upload';
export const STATIC_FILES_ROUTE = '/static';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему храним константы тут, а потом используем в shared? Думаю лучше тогда их в shared переместить, иначе у тебя shared пакет зависит от src/rest, что не правильно, shared не должны зависеть от бизнес слоя, каковым является rest в src

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перенес в shared

@keksobot
keksobot merged commit 8c285d3 into htmlacademy-nodejs-api:master May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants