문제

I've built an application using the Locomotive.JS MVC framework for node (locomotive is built upon express) , i wanted know how to start this application using nodemon??

도움이 되었습니까?

해결책

Looking at this blog post, if you don't already have a server.js, you need to create one to run your application, in order to use nodemon.

In the project directory, create a server.js file:

var locomotive = require('locomotive'),
        env = process.env.NODE_ENV || 'development',
        port = process.env.PORT || 3000,
        address = '0.0.0.0';

locomotive.boot(__dirname, env, function(err, server) {
    if (err) { throw err; }
    server.listen(port, address, function() {
      var addr = this.address();
      console.log('listening on %s:%d', addr.address, addr.port);
    });
});

Then simply run:

nodemon server.js
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top