永远运行一个Node.js Angular.js Gulp.js应用程序

我正在使用Angular.js和Gulp.js Web应用程序,并希望永久在Ubuntu 12.04环境中运行它。 我在这个环境中安装了Angular&Bootstrap 4仪表板锅炉。 它带有Gulp作为构build工具。 现在我想永久运行这个应用程序,以使客户/网站访问者可访问。 我读了关于Gulp Forever和Gulp Forever Monitor的内容,并安装了这些模块,但是他们没有做到这一点。 应用程序在一段时间后总是closures,我必须通过terminal在环境中重新启动它。

那么,永久运行Gulp应用程序的最佳方法是什么? 我该怎么做,我需要安装什么? 由于我是新手,任何提示和build议,将不胜感激,谢谢!

这里是gulpfile.js,它包含gulp服务任务:

'use strict'; var gulp = require('gulp'); var wrench = require('wrench'); var forever = require('gulp-forever-monitor'); wrench.readdirSyncRecursive('./gulp').filter(function(file) { return (/\.(js)$/i).test(file); }).map(function(file) { require('./gulp/' + file); }); gulp.task('default', ['clean'], function () { gulp.start('build'); }); /* gulp.task('run:server', function() { var foreverMonitorOptions = { env: process.env, args: process.argv, watch: true, // can pass if you set any watch option, for example watchIgnorePatterns watchIgnorePatterns: ['.*', 'node_modules/**', 'public/**', 'temp/**'] } forever('gulpfile.js', foreverMonitorOptions) .on('watch:restart', function(fileInfo) { console.log('server was restarted'); }) .on('exit', function() { console.log('server was closed'); }) gulp.start('build'); }) */ 

你可以尝试使用普通的永远 。 它可以用来保持从命令行运行的任何脚本。