!7 static int refreshDelay = 1; // seconds // TODO: share transpiler html { if (!webAuthed(params)) ret "not authed"; if (eq("1", params.get('fresh))) refreshTranspiler(); uri = dropPrefixSlash(uri); if (isSnippetID(uri)) params.put(snippetID := uri); if (empty(params.get('snippetID))) ret "OK"; final bool compile = eq("1", params.get('compile)); final new Flag ok; S text = hijackPrint_tee(r { S snippetID = fsI(params.get('snippetID)); pcall { temp tempSetTL(transpileForServer_compile, compile); transpileForServer(snippetID); ok.raise(); } }); S redirect = params.get('redirect); ret hhtml(hhead(htitle((ok.isUp() ? "OK" : "Failed") + " Transpilation") + (ok.isUp() && nempty(redirect) ? hrefresh(refreshDelay, redirect) : "")) + hbody(hsourcecode(text))); }