Warn if editor routes are accessed but runtime not started

Closes #816
This commit is contained in:
Nick O'Leary
2016-03-12 00:03:50 +00:00
parent 7281e4deb6
commit e941c22f6c
3 changed files with 65 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2013, 2015 IBM Corp.
* Copyright 2013, 2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,8 @@ var os = require("os");
var runtimeMetricInterval = null;
var started = false;
var stubbedExpressApp = {
get: function() {},
post: function() {},
@@ -142,6 +144,7 @@ function start() {
log.info(log._("runtime.paths.settings",{path:settings.settingsFile}));
}
redNodes.loadFlows().then(redNodes.startFlows);
started = true;
}).otherwise(function(err) {
console.log(err);
});
@@ -173,6 +176,7 @@ function stop() {
clearInterval(runtimeMetricInterval);
runtimeMetricInterval = null;
}
started = false;
return redNodes.stopFlows();
}
@@ -190,5 +194,8 @@ var runtime = module.exports = {
events: events,
nodes: redNodes,
util: require("./util"),
get adminApi() { return adminApi }
get adminApi() { return adminApi },
isStarted: function() {
return started;
}
}