]> git.cworth.org Git - empires-server/commitdiff
Incorporate empires.js as a sub-app within lmno.js
authorCarl Worth <cworth@cworth.org>
Sun, 17 May 2020 19:40:44 +0000 (12:40 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 17 May 2020 22:36:18 +0000 (15:36 -0700)
Now, instead of calling listen() the empires.js simply exports its app
object so that the higher level lmno server can mount all of its
available paths with app.use('/empires/<GAMEID>/', empires.app).

At the same time, empires.js no longer constructs a Game object, but
instead the higher-level /new API within lmno.js calls into
empires.Game to create a game for a specific ID. Then, there's also a
new middleware in lmno.js to lookup this game object by the ID from
the path and add it as a property of the request object. So all of the
empires.js entry points now fetch that game object from the request as
their first statement.


No differences found