diff --git a/index.mjs b/index.mjs index 93bfd5a..c159aa4 100644 --- a/index.mjs +++ b/index.mjs @@ -8,7 +8,8 @@ import fs from "fs"; import dotenv from "dotenv"; import ElasticSearch from "@elastic/elasticsearch"; import AWS from "aws-sdk"; -import { json, urlencoded } from "body-parser"; +import parser from "body-parser"; +import cors from "cors"; import parse from "url-parse"; import createAwsElasticsearchConnector from "aws-elasticsearch-connector"; dotenv.config(); @@ -32,7 +33,7 @@ const lookup = geolite2.open("GeoLite2-City", (path) => { }); polka() - .use(cors(), urlencoded(), json()) + .use(cors(), parser.urlencoded({ extended: true }), parser.json()) .all("/", (req, res) => { // Get data from query and body const data = { ...req.query, date: new Date() };