Archived
1
0

Expose replaceTemplates to plugins

This is mainly so they can get relative paths in their HTML, in
particular code-server's static base so they can use the favicon and
service worker.
This commit is contained in:
Asher
2021-01-28 14:24:07 -06:00
parent 36aad9bdab
commit 22d194515a
2 changed files with 14 additions and 0 deletions

View File

@ -123,8 +123,20 @@ export { express }
*/
export { field, Level, Logger }
/**
* code-server's proxy server.
*/
export const proxy: ProxyServer
/**
* Replace variables in HTML: TO, BASE, CS_STATIC_BASE, and OPTIONS.
*/
export function replaceTemplates<T extends object>(
req: express.Request,
content: string,
extraOpts?: Omit<T, "base" | "csStaticBase" | "logLevel">,
): string
/**
* Your plugin module must have a top level export "plugin" that implements this interface.
*