Switched to body-parser

master
Keith Irwin 2021-11-24 18:09:22 -07:00
parent da7a3e0992
commit bfe25d1926
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 6 additions and 4 deletions

View File

@ -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`)

View File

@ -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",