1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-07 02:53:00 +00:00

Network performance optimizations for node.js (#5436)

This commit is contained in:
FlashSystems
2021-05-08 17:05:39 +02:00
committed by GitHub
parent e699cf1fe8
commit f4d7b2c7f7
10 changed files with 83 additions and 39 deletions

View File

@@ -32,9 +32,9 @@ exports.handler = function(request,response,state) {
renderTemplate = renderTemplate || state.server.get("tiddler-render-template");
}
var text = state.wiki.renderTiddler(renderType,renderTemplate,{parseAsInline: true, variables: {currentTiddler: title}});
// Naughty not to set a content-type, but it's the easiest way to ensure the browser will see HTML pages as HTML, and accept plain text tiddlers as CSS or JS
response.writeHead(200);
response.end(text,"utf8");
state.sendResponse(200,{},text,"utf8");
} else {
response.writeHead(404);
response.end();