diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-03-30 22:01:09 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-03-30 22:01:09 +0000 |
| commit | 26f7cefe6379e9b76f5bb1963433a6832a55caa6 (patch) | |
| tree | 684d647f040ab05fcae66d9c9ebb68ce13b552c4 /lib/web.js | |
| parent | 49e22a72504df97195d82d4349f7e0f0fb0c8bb3 (diff) | |
Allow path to be passed into convertToHtml
Diffstat (limited to 'lib/web.js')
| -rw-r--r-- | lib/web.js | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -4,7 +4,6 @@ var url = require("url"); var fs = require("fs"); var q = require("q"); var mammoth = require("./"); -var ZipFile = require("zipfile").ZipFile; function startServer(options) { var app = connect() @@ -49,18 +48,8 @@ function handleConvert(request, response, next) { var converter = new mammoth.Converter(mammoth.standardOptions); var uploadedDocument = request.files.document; var documentPath = uploadedDocument.path - // TODO: remove duplication from index.js - var zipFile = new ZipFile(documentPath); - var docxFile = { - read: function(path) { - return q.ninvoke(zipFile, "readFile", path, "utf-8") - .then(function(value) { - return value.toString(); - }); - } - }; - converter.convertToHtml(docxFile) + converter.convertToHtml(documentPath) .then(function(result) { request.template = { name: "convert.html", |
