0

I wrote a simple server

var express = require('express')
var app = express()
app.post('/', function(req, res){
   res.send('hi')
})
app.listen(3000, ()=>{
console.log('listening on 3000')
})

I deployed it on the server post don't responding till I send a get request to it what is the problem? It works on localhost but not on the server

Server OS is ubuntu 16.04 I know it's on port 3000 and I know it's a post method so I send post request please don't mention it.

There is no problem with code I think problem is related to Ubuntu. Any changes should I make?

Ali Rasooli
  • 401
  • 1
  • 5
  • 7

0 Answers0