]> git.cworth.org Git - empires-server/commit
empathy: Better separation of concerns between routes and game class
authorCarl Worth <cworth@cworth.org>
Tue, 9 Jun 2020 15:03:58 +0000 (08:03 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 9 Jun 2020 15:03:58 +0000 (08:03 -0700)
commit0787b1e92bfb59e3f2c4e8953ca5d898ff04bee3
treee5ad7c01121259ac32747d0c4dbdecb62138769b
parentf2a237f13592e30e93dd056efd09087e57f4ce05
empathy: Better separation of concerns between routes and game class

In this commit we make the route handlers much simpler: Their job is
to parse data from the received request and provide a response to the
client, (such as an appropriate status code), but otherwise, the meat
of the functionality is provided by methods on the Empathy class).

This separation should lead to more maintainable code as the
implementations on both sides are smaller and more focused on a single
job.
empathy.js