Skip to content

Commit

Permalink
[dist] Added mainteinance page
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro committed Mar 24, 2012
1 parent 1fdae9f commit 97530bb
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/app.js
Expand Up @@ -909,7 +909,8 @@ var app_start = function (repo_id, callback) {
console.log('Writing config data: ', path.join(configData.apprwfolder, '.nodester', 'config.json'));

// Insert watcher code;
if (lib.insert_code(configData.apphome,app.start,lib.watcher_code(config.opt.watcher.user,config.opt.watcher.password))) {
if (lib.insert_code(configData.apphome,app.start,
lib.watcher_code(config.opt.watcher.user,config.opt.watcher.password))) {
console.log('Watcher code inserted...');
} else {
console.log('Failed to insert Watcher code ');
Expand Down
64 changes: 64 additions & 0 deletions offline.js
@@ -0,0 +1,64 @@
#!/usr/bin/env node

/*
Nodester opensource Node.js hosting service
Written by: @_alejandromg
http://nodester.com
*/

var express = require('express'),
url = require('url'),
sys = require('sys'),
config = require('./config'),
middle = require('./lib/middle');

process.on('uncaughtException', function (err) {
console.log(err.stack);
});


// daemon.setreuid(config.opt.userid);
var myapp = express.createServer();

myapp.configure(function () {
myapp.use(express.bodyParser());
myapp.use(express.static(__dirname+'/public/images'));
myapp.use(express.errorHandler({
showStack: true,
dumpExceptions: true
}));
});


// Error handler
myapp.error(function (err, req, res, next) {
if (err instanceof NotFound) {
res.sendfile(__dirname + '/public/404.html');
} else {
res.sendfile(__dirname + '/public/500.html');
}
});

/* Routes */
myapp.all('*',function(req,res,next){
res.sendfile(__dirname+'/public/offline.html');
})
myapp.all('/images/*',function(req,res){
res.sendfile(__dirname+'/public/'+req.url);
})
myapp.get('/',function(req,res){
res.sendfile(__dirname+'/public/offline.html');
})
// Homepage
myapp.listen(4001);
console.log('Nodester mainteinance app started on port 4001');


function NotFound(msg) {
this.name = 'NotFound';
Error.call(this, msg);
Error.captureStackTrace(this, arguments.callee);
};
Binary file added public/images/rocket-in-mainteinance.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/offline.html
@@ -0,0 +1,18 @@

<!doctype>
<html>
<head>
<title>We're on mainteinance mode</title>
</head>
<style type="text/css">
body,html {text-align: center;background-color: gold;color: white;font-weight: bold;font-family:Arial;}
#ST { border: 10px solid white;box-shadow: 1px 1px rgba(0,0,0,0.2);}
#rocket {position: absolute;left: 70%;top: 400px;}
p {color:#222;}
</style>
<body>
<img src="rocket-md-right.png" width="60" id="rocket">
<a href="http://rocketstreetfood.wordpress.com/2012/01/10/no-launch-today-rocket-in-for-generator-repair-oddo-print-shop-tomorrow/"><img src="rocket-in-mainteinance.jpg" id="ST"></a>
<h1>N02</h1>
<p> Nodester in Mainteinance Mode </p><p> Go and grab some coffee we are back in a sec</p>
</body>

0 comments on commit 97530bb

Please sign in to comment.