From 1281c9b2becbe1b2b621f040861b2e40ec8411b9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 28 Jan 2019 15:28:38 +0100 Subject: [PATCH] remove some dead serverside code --- server.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/server.js b/server.js index 347140b7c..7e0869dba 100644 --- a/server.js +++ b/server.js @@ -211,28 +211,6 @@ var send404 = function (res, path) { }); }; -var FONT_NAME_MAP = {}; -[ './www/common/onlyoffice/fonts/' ].forEach(function (path) { - Fs.readdir(path, function (err, list) { - if (err) { throw err; } - list.forEach(function (fontName) { - FONT_NAME_MAP[fontName.toLowerCase()] = path + fontName; - }); - }); -}); - -/* Code to automatically transform font to js */ -/* Currently not active, but might be necessary */ -app.use("/common/onlyoffice/fonts/odttf/:name", function (req, res) { - var name = req.params.name.replace(/\.js$/, '').toLowerCase(); - var path = Path.join('./www/common/onlyoffice/fonts/odttf/', name); - console.log(path); - Fs.createReadStream(path).pipe(res).on('error', function (e) { - console.error(e); - res.status(404).send('No such font'); - }); -}); - /* All fonts file replaced by the list of fonts in ttf */ app.use("/common/onlyoffice/sdkjs/common/AllFonts.js", Express.static("./www/common/onlyoffice/AllFonts.js"));