Skip to content

Conversation

@mprudnik
Copy link
Owner

No description provided.

@mprudnik mprudnik requested a review from georgolden December 21, 2022 13:53
Copy link
Collaborator

@georgolden georgolden left a comment

Choose a reason for hiding this comment

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

Overall:

  • There is a job that can be handled independently from other parts of the application - creating instances. Creating instances and DI are jobs that are better kept in one place. Right now it is widespread.
  • Configs are only needed during instanciating
  • Using index.js files. It makes things very unclear. If you want to have a collection of routes or a collection of services better to use services.js or routes.js instead. And it is better to not handle instances here.
  • Closure is nice, but try to move as much code as possible out of closure to make it purer. It is generally OK to use closures instead of classes.

Copy link
Collaborator

@georgolden georgolden left a comment

Choose a reason for hiding this comment

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

Great job overall!

Comment on lines +12 to +26
server: {
host: process.env.HOST || '0.0.0.0',
port: Number(process.env.PORT) || 9000,
instance: {},
cors: {
origin: '*',
methods: '*',
allowedHeaders: '*',
credentials: true,
},
swagger: {
title: 'Test',
version: '1.0.0',
routePrefix: '/docs',
serverUrl: process.env.SERVER_URL || 'http://localhost:9000',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest moving cors and swagger as separate configs. Better to keep tiny configs

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