diff --git a/index.js b/index.js index a734cf9..a97b6df 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ require('dotenv').config() const express = require('express') const app = express() +const bodyParser = require('body-parser') const {verify} = require('hcaptcha') const mailer = require('nodemailer').createTransport({ @@ -15,10 +16,10 @@ const mailer = require('nodemailer').createTransport({ }, }) -app.use(express.json()) -app.get('/', (req, res) => { - res.send('Hello') -}) +//app.use(express.json()) + +app.use(bodyParser.json()) + app.post('/', async (req, res) => { console.log(`Received POST`) diff --git a/package.json b/package.json index f286e50..5469371 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "Keith Irwin", "license": "MIT", "dependencies": { + "body-parser": "^1.19.0", "dotenv": "^10.0.0", "express": "^4.17.1", "hcaptcha": "^0.1.0",