-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
27 lines (20 loc) · 1020 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*eslint-env node*/
//------------------------------------------------------------------------------
// node.js starter application for Bluemix
//------------------------------------------------------------------------------
// This application uses express as its web server
// for more info, see: http://expressjs.com
var express = require('express');
var http = require('http');
var environment = require('./environment');
var operations = require('./operations');
// create a new express server
var app = express();
//run the backup every 24 hours, or 86400000 milliseconds
setInterval( operations.backupCloudObjectStorage, environment.backup_interval);
//serve the files out of ./public as our main files
app.use(express.static(__dirname + '/public'));
http.createServer(app).listen(environment.VCAP_APP_PORT, environment.VCAP_APP_HOST, function(){
console.log("Storage application started: " + environment.VCAP_APP_HOST + ":" + environment.VCAP_APP_PORT);
operations.backupCloudObjectStorage();
});