Skip to content

Commit f6b04c7

Browse files
committed
Expose proxy server to plugins
1 parent a8e9287 commit f6b04c7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/node/plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Logger, field } from "@coder/logger"
1+
import { field, Logger } from "@coder/logger"
22
import * as express from "express"
33
import * as fs from "fs"
44
import * as path from "path"
55
import * as semver from "semver"
66
import * as pluginapi from "../../typings/pluginapi"
77
import { version } from "./constants"
8+
import { proxy } from "./proxy"
89
import * as util from "./util"
910
const fsp = fs.promises
1011

@@ -19,6 +20,7 @@ require("module")._load = function (request: string, parent: object, isMain: boo
1920
return {
2021
express,
2122
field,
23+
proxy,
2224
}
2325
}
2426
return originalLoad.apply(this, [request, parent, isMain])

typings/pluginapi.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export { express }
9494
*/
9595
export { field }
9696

97+
export const proxy: ProxyServer
98+
9799
/**
98100
* Your plugin module must have a top level export "plugin" that implements this interface.
99101
*

0 commit comments

Comments
 (0)