]> git.cworth.org Git - lmno-server/commit
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)
commit74fbb20db7ae89671f020a60e77f8d55ec17ee1f
tree8bd73a01ced061551cb016418a3e0140bbe617a2
parent74ae0ff19c7a25caf39944ebbf25202f31e48bf8
Incorporate empires.js as a sub-app within lmno.js

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.
empires.js
lmno.js