Skip to content

Commit 210fc04

Browse files
committed
Document VS Code endpoints
1 parent e5c8e0a commit 210fc04

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/node/routes/static.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ router.get("/(:commit)(/*)?", async (req, res) => {
3232
res.header("Cache-Control", "public, max-age=31536000")
3333
}
3434

35+
/**
36+
* Used by VS Code to load extensions into the web worker.
37+
*/
3538
const tar = Array.isArray(req.query.tar) ? req.query.tar[0] : req.query.tar
3639
if (typeof tar === "string") {
3740
let stream: Readable = tarFs.pack(pathToFsPath(tar))

src/node/routes/vscode.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ router.ws("/", async (socket, _, req) => {
7171
await vscode.sendWebsocket(socket, req.query)
7272
})
7373

74+
/**
75+
* TODO: Might currently be unused.
76+
*/
7477
router.get("/resource(/*)?", async (req, res) => {
7578
ensureAuthenticated(req)
7679
if (typeof req.query.path === "string") {
@@ -79,6 +82,9 @@ router.get("/resource(/*)?", async (req, res) => {
7982
}
8083
})
8184

85+
/**
86+
* Used by VS Code to load files.
87+
*/
8288
router.get("/vscode-remote-resource(/*)?", async (req, res) => {
8389
ensureAuthenticated(req)
8490
if (typeof req.query.path === "string") {
@@ -87,6 +93,10 @@ router.get("/vscode-remote-resource(/*)?", async (req, res) => {
8793
}
8894
})
8995

96+
/**
97+
* VS Code webviews use these paths to load files and to load webview assets
98+
* like HTML and JavaScript.
99+
*/
90100
router.get("/webview/*", async (req, res) => {
91101
ensureAuthenticated(req)
92102
res.set("Content-Type", getMediaMime(req.path))

0 commit comments

Comments
 (0)