Skip to content

Commit 18fa4c9

Browse files
refactor: replace body-parser with express's built-in body parsing
1 parent 6a60380 commit 18fa4c9

File tree

3 files changed

+2
-311
lines changed

3 files changed

+2
-311
lines changed

API/api.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
const path = require("path");
1212
const url = require("url");
1313
const {v4: uuid} = require("uuid");
14-
const bodyParser = require("body-parser");
1514
const express = require("express");
1615

1716
module.exports = {
@@ -109,8 +108,8 @@ module.exports = {
109108

110109
this.getApiKey();
111110

112-
this.expressApp.use(bodyParser.urlencoded({extended: true}));
113-
this.expressApp.use(bodyParser.json());
111+
this.expressApp.use(express.urlencoded({extended: true}));
112+
this.expressApp.use(express.json());
114113

115114
this.expressApp.use("/api/docs", express.static(path.join(__dirname, "../docs"))); // Docs without apikey
116115

0 commit comments

Comments
 (0)