From 0cd4f406b4ace0bc16d84adf4573f3a0d8084ad5 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 21 May 2020 09:23:40 -0700 Subject: [PATCH] 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. --- empires.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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. */ -- 2.43.0