永远运行一个Node.js Angular.js Gulp.js应用
Running a Node.js Angular.js Gulp.js application forever
我正在研究一个Angular.js和Gulp.js web应用程序,并希望在Ubuntu 12.04环境中永久运行它。我安装了Angular &在这种环境下启动4仪表盘锅炉。它是作为构建工具随Gulp一起提供的。现在我想永久运行这个应用程序,以使客户/网站访问者可以访问它。我读了关于Gulp Forever和Gulp Forever Monitor的介绍,并安装了这些模块,但它们并没有奏效。应用程序总是在一段时间后关闭,我必须通过终端在环境中重新启动它。
那么,永远运行Gulp应用程序的最佳方式是什么呢?我要怎么做,我需要安装什么?由于我是新的,任何提示和建议将不胜感激,谢谢!
下面是gulpfile.js,其中包含了gulp server任务:
'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');
})
*/
您可以尝试使用plain Forever。
相关文章:
- 在索引.html和应用.js [node.js] 之间共享变量
- JS(node.js)而循环不起作用
- 如何使用 JS (Node.js) 防止 HTTP 查询中允许使用 UTF8 字符串
- Angular JS & Node Webkit Routing
- 当作为脚本运行时.js Node中“this”的上下文是什么
- JS/Node:- 使用 node.io 选择标记
- JavaScript 如何让节点在返回 node.js/Node-RED 之前等待
- 处理快速连续的函数调用 - Javascript / underscore.js / node.js
- 如何在一台服务器中运行不同的.js文件.js NODE JS中的文件
- JS node-mysql bools 表现得很奇怪
- Node.js+Node Webkit+基于Node串行端口的应用程序-这可能吗
- 如何在Express.js/Node.js中检查查询字符串是否有值
- Express.Js, Node.Js, MongoDB Questions
- 在JS/Node中,当多个人编辑相同的记录时,如何避免数据冲突?有图案吗
- 服务器端js(node.js)上的同步
- 将参数从jade发送到js/node
- angular.js+node.js/electron中的Promise;不起作用
- 是否有可能确定我的应用程序的aws实例使用js/node aws-sdk
- Image Magick模块抛出奇怪的错误(Express js Node js)
- 用JS (Node.js)读取文本文件'