Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ebe0c42

Browse files
committedMar 17, 2022
Move manifest override into code-server
This way we will not have to patch it.
1 parent bef22bb commit ebe0c42

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎src/node/routes/vscode.ts

+24
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,29 @@ export class CodeServerRouteWrapper {
3535

3636
//#region Route Handlers
3737

38+
private manifest: express.Handler = async (req, res, next) => {
39+
res.writeHead(200, { "Content-Type": "application/manifest+json" })
40+
41+
return res.end(
42+
JSON.stringify(
43+
{
44+
name: "code-server",
45+
short_name: "code-server",
46+
start_url: ".",
47+
display: "fullscreen",
48+
description: "Run Code on a remote server.",
49+
icons: [192, 512].map((size) => ({
50+
src: `./_static/src/browser/media/pwa-icon-${size}.png`,
51+
type: "image/png",
52+
sizes: `${size}x${size}`,
53+
})),
54+
},
55+
null,
56+
2,
57+
),
58+
)
59+
}
60+
3861
private $root: express.Handler = async (req, res, next) => {
3962
const isAuthenticated = await authenticated(req)
4063
const NO_FOLDER_OR_WORKSPACE_QUERY = !req.query.folder && !req.query.workspace
@@ -153,6 +176,7 @@ export class CodeServerRouteWrapper {
153176

154177
constructor() {
155178
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
179+
this.router.get(/manifest.json$/, this.manifest)
156180
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
157181
this._wsRouterWrapper.ws("/", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
158182
}

0 commit comments

Comments
 (0)
Please sign in to comment.