mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
nice pad urls
This commit is contained in:
parent
5af7e8da7f
commit
7f6f734dbc
1 changed files with 39 additions and 39 deletions
|
@ -200,6 +200,45 @@ async.waterfall([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//The Etherpad client side sends information about client side javscript errors
|
||||||
|
app.post('/jserror', function(req, res)
|
||||||
|
{
|
||||||
|
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
||||||
|
{
|
||||||
|
console.error("CLIENT SIDE JAVASCRIPT ERROR: " + fields.errorInfo);
|
||||||
|
res.end("OK");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//serve index.html under /
|
||||||
|
app.get('/', function(req, res)
|
||||||
|
{
|
||||||
|
var filePath = path.normalize(__dirname + "/../static/index.html");
|
||||||
|
res.sendfile(filePath, { maxAge: exports.maxAge });
|
||||||
|
});
|
||||||
|
|
||||||
|
//serve robots.txt
|
||||||
|
app.get('/robots.txt', function(req, res)
|
||||||
|
{
|
||||||
|
var filePath = path.normalize(__dirname + "/../static/robots.txt");
|
||||||
|
res.sendfile(filePath, { maxAge: exports.maxAge });
|
||||||
|
});
|
||||||
|
|
||||||
|
//serve favicon.ico
|
||||||
|
app.get('/favicon.ico', function(req, res)
|
||||||
|
{
|
||||||
|
var filePath = path.normalize(__dirname + "/../static/custom/favicon.ico");
|
||||||
|
res.sendfile(filePath, { maxAge: exports.maxAge }, function(err)
|
||||||
|
{
|
||||||
|
//there is no custom favicon, send the default favicon
|
||||||
|
if(err)
|
||||||
|
{
|
||||||
|
filePath = path.normalize(__dirname + "/../static/favicon.ico");
|
||||||
|
res.sendfile(filePath, { maxAge: exports.maxAge });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
//serve read only pad
|
//serve read only pad
|
||||||
app.get('/ro/:id', function(req, res)
|
app.get('/ro/:id', function(req, res)
|
||||||
{
|
{
|
||||||
|
@ -367,45 +406,6 @@ async.waterfall([
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//The Etherpad client side sends information about client side javscript errors
|
|
||||||
app.post('/jserror', function(req, res)
|
|
||||||
{
|
|
||||||
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
|
||||||
{
|
|
||||||
console.error("CLIENT SIDE JAVASCRIPT ERROR: " + fields.errorInfo);
|
|
||||||
res.end("OK");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//serve index.html under /
|
|
||||||
app.get('/', function(req, res)
|
|
||||||
{
|
|
||||||
var filePath = path.normalize(__dirname + "/../static/index.html");
|
|
||||||
res.sendfile(filePath, { maxAge: exports.maxAge });
|
|
||||||
});
|
|
||||||
|
|
||||||
//serve robots.txt
|
|
||||||
app.get('/robots.txt', function(req, res)
|
|
||||||
{
|
|
||||||
var filePath = path.normalize(__dirname + "/../static/robots.txt");
|
|
||||||
res.sendfile(filePath, { maxAge: exports.maxAge });
|
|
||||||
});
|
|
||||||
|
|
||||||
//serve favicon.ico
|
|
||||||
app.get('/favicon.ico', function(req, res)
|
|
||||||
{
|
|
||||||
var filePath = path.normalize(__dirname + "/../static/custom/favicon.ico");
|
|
||||||
res.sendfile(filePath, { maxAge: exports.maxAge }, function(err)
|
|
||||||
{
|
|
||||||
//there is no custom favicon, send the default favicon
|
|
||||||
if(err)
|
|
||||||
{
|
|
||||||
filePath = path.normalize(__dirname + "/../static/favicon.ico");
|
|
||||||
res.sendfile(filePath, { maxAge: exports.maxAge });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//let the server listen
|
//let the server listen
|
||||||
app.listen(settings.port, settings.ip);
|
app.listen(settings.port, settings.ip);
|
||||||
console.log("Server is listening at " + settings.ip + ":" + settings.port);
|
console.log("Server is listening at " + settings.ip + ":" + settings.port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue