0
const express = require('express')
const app = express()
const port = 3000

app.post('/', (req, res) => {
  res.send('Hello World!')
})

// app.post('/post', (req, res) => {
//   res.send('Hello World!')
// })

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})

*its a normal express post request but when am calling it am getting following error

localhost/:1 GET http://localhost:3000/ 404 (Not Found)

but get(),all() methods are working fine

1 Answers1

0

All requests that you hit manually in browser address bar are of GET type. To send POST or any other request types you should be using postman. See - https://learning.postman.com/docs/getting-started/sending-the-first-request/

Kamesh
  • 1,122
  • 9
  • 12