]> git.cworth.org Git - empires-server/commitdiff
empires: Pull the body_parser use statements up to the top of the file
authorCarl Worth <cworth@cworth.org>
Thu, 21 May 2020 16:23:40 +0000 (09:23 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 21 May 2020 16:23:40 +0000 (09:23 -0700)
Just keeping things organized by enabling all of our dependencies up
at the top of the file.

empires.js

index 593598ad6153c5c524fd2dfeaf7274f07cc36b63..69fc7c233a64c146b40cff97bb6826cb3e01be29 100644 (file)
@@ -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. */