Coder Social home page Coder Social logo

microservicesample's People

Contributors

ashkan-pm avatar babak1368 avatar

Watchers

 avatar  avatar

microservicesample's Issues

I think a formatter like prettier would have also been very useful

data.firstName += data.code; // FOR MAKE THE field UNIQIE to understand scenario

//let result = await customerRepository.insert(data);

if (result) customerProducer.sendCreationMessageAcrossTheNodes(data); // pushing across the nodes / added by babak

There are a lot of blank lines and misaligned spaces in a lot of places. Again easy problem to overlook, but it's also easy to fix.

HTTP API doesn't look very RESTful

router.get('/customer/list', customerController.listHandler);
router.post('/customer/create', customerValidator.validateCreate, customerController.createHandler);
router.post('/customer/update', customerValidator.validateUpdate, customerController.updateHandler);
router.post('/customer/delete', customerValidator.validateDelete, customerController.deleteHandler);

This is not a RESTful API in my opinion. An actual RESTful HTTP API for this resource with your controllers would look like this:

router.get('/customer', customerController.listHandler); 
router.post('/customer', customerValidator.validateCreate, customerController.createHandler); 
router.patch('/customer', customerValidator.validateUpdate, customerController.updateHandler); 
router.delete('/customer', customerValidator.validateDelete, customerController.deleteHandler);

Probably would have been a good idea to set up Eslint

let result = await customerRepository.getAll();

Why let? I mean these are small issues that can even be solved using static analysis of the code and they are in other places in the repo as well. I won't comment on all of them, but Eslint would have been able to catch these little mistakes and even fix them automatically.

Another example:

listHandler = async function (request, response) {

Would be nicer to have _ for the unused variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.