Added support for exporting html

This commit is contained in:
Erlend Halvorsen 2011-07-06 14:57:07 +02:00 committed by Peter 'Pita' Martischka
parent 6f59835474
commit 7cf1a50fff
3 changed files with 427 additions and 2 deletions

View file

@ -31,6 +31,8 @@ var async = require('async');
var express = require('express');
var path = require('path');
var minify = require('./minify');
var exporthtml = require("./exporters/exporthtml");
var padManager = require("./PadManager");
//try to get the git version
var version = "";
@ -107,6 +109,14 @@ async.waterfall([
res.sendfile(filePath, { maxAge: exports.maxAge });
});
app.get("/p/:pad/html", function (req, res) {
padManager.getPad(req.params.pad, function (err, pad) {
exporthtml.getPadHTMLDocument(pad, null, false, function (err, html) {
res.send(html);
});
});
});
//serve timeslider.html under /p/$padname/timeslider
app.get('/p/:pad/timeslider', function(req, res, next)
{