Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |