]> git.cworth.org Git - lmno-server/commitdiff
Drop body-parser as external dependency
authorCarl Worth <cworth@cworth.org>
Mon, 9 Mar 2026 17:06:41 +0000 (10:06 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 9 Mar 2026 17:06:41 +0000 (10:06 -0700)
This isn't needed as we can now just use the json() and urlencoded()
functions that are directly built into express.

lmno.js
package.json

diff --git a/lmno.js b/lmno.js
index cb94610baa7432ae98d7690fb9d4deeef0626ca4..0f89f0fc7a79a2be25fd9ba6b5c31ab0388b8f31 100644 (file)
--- a/lmno.js
+++ b/lmno.js
@@ -1,6 +1,5 @@
 const express = require("express");
 const cors = require("cors");
-const body_parser = require("body-parser");
 const session = require("express-session");
 const bcrypt = require("bcrypt");
 const fs = require("fs");
@@ -54,8 +53,8 @@ app.use(express.static(path.join(__dirname, '..', 'lmno.games')));
  */
 app.set('trust proxy', true);
 app.use(cors());
-app.use(body_parser.urlencoded({ extended: false }));
-app.use(body_parser.json());
+app.use(express.urlencoded({ extended: false }));
+app.use(express.json());
 /* Ensure data directory exists before creating session store. */
 if (!fs.existsSync(DATA_DIR)) {
   fs.mkdirSync(DATA_DIR);
index fc1cdabc3e5bdac3f67d47086c079b6d9bb3b8f2..8649bc4ce78c5cdd84ed9fd18095245e778325ef 100644 (file)
@@ -10,7 +10,6 @@
   "license": "ISC",
   "dependencies": {
     "bcrypt": "^4.0.1",
-    "body-parser": "^1.19.0",
     "cors": "^2.8.5",
     "express": "^4.17.1",
     "express-session": "^1.17.1",