1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Create lib dir on start-up if needed

This commit is contained in:
Nicholas O'Leary 2013-09-20 14:21:45 +01:00
parent 8eb2bcbd9c
commit 6f8adc9f14

View File

@ -29,7 +29,12 @@ function createServer(_server,settings) {
//TODO: relocated user dir //TODO: relocated user dir
var rulesfile = process.argv[2] || 'flows_'+host+'.json'; var rulesfile = process.argv[2] || 'flows_'+host+'.json';
fs.exists("lib/",function(exists) {
if (!exists) {
fs.mkdir("lib");
}
});
app.get("/nodes",function(req,res) { app.get("/nodes",function(req,res) {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.write(redNodes.getNodeConfigs()); res.write(redNodes.getNodeConfigs());