From: Carl Worth Date: Thu, 21 May 2020 16:23:40 +0000 (-0700) Subject: empires: Pull the body_parser use statements up to the top of the file X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=commitdiff_plain;h=0cd4f406b4ace0bc16d84adf4573f3a0d8084ad5 empires: Pull the body_parser use statements up to the top of the file Just keeping things organized by enabling all of our dependencies up at the top of the file. --- diff --git a/empires.js b/empires.js index 593598a..69fc7c2 100644 --- a/empires.js +++ b/empires.js @@ -5,6 +5,8 @@ const path = require("path"); const app = express(); app.use(cors()); +app.use(body_parser.urlencoded({ extended: false })); +app.use(body_parser.json()); const GameState = { JOIN: 1, @@ -208,9 +210,6 @@ class Game { } } -app.use(body_parser.urlencoded({ extended: false })); -app.use(body_parser.json()); - function handle_events(request, response) { const game = request.game; /* These headers will keep the connection open so we can stream events. */