node.js - Why this port number is not acceptable for my localhost server? -


i have hapi.js code below: ` 'use strict';

const hapi = require("hapi");  const server = new hapi.server();  server.connection({     host: 'localhost',     port: 2922, });  server.route({     method: 'get',     path: '/hello',     handler: function (req, res) {                     res('hello world hapi.js');     } });  server.start((err) => { }); 

` problem when run server port number 22291 executes , exit without error, reason for? using linux centos 7

you need check error in start callback:

server.start((err) => {    if (err) throw err; }); 

that give details need debug. make sure check errors in callbacks or you'll repeatedly run problem in node.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -