Starting Mojito application on a particular IP address


It seems mojito start command only allows users to provide port numbers. I am wondering if IP addresses are also allowed? If so how do we provide and how to start the application?

Basically, how do i make my application listen to an ip address?

Any help would be really appreciated!

Thanks, Krati

2 Replies
  • Hi Krati,

    Specifying a host/ip isn't supported by the mojito cli at the moment. But this should work-- make a file, (say server.js) in your app base directory, and use node server.js

    var mojito = require('mojito').createServer(),
        port = 8111,
        host = '';
    mojito.listen(port, host, function(err, app) {
        console.log('listening on %s:%d', host, port);
  • Thanks a ton isao! I'll try that out. Looks like the mojito-cli creates a web server that listens on an active interface. I think the cli should allow to specific IP address too in the future.


Recent Posts

in Yahoo! Mojito