File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as express from "express"
3
3
import * as fs from "fs"
4
4
import * as path from "path"
5
5
import { HttpCode } from "../src/common/http"
6
+ import { AuthType } from "../src/node/cli"
6
7
import { codeServer , PluginAPI } from "../src/node/plugin"
7
8
import * as apps from "../src/node/routes/apps"
8
9
import * as httpserver from "./httpserver"
@@ -26,6 +27,28 @@ describe("plugin", () => {
26
27
27
28
const app = express . default ( )
28
29
const wsApp = express . default ( )
30
+
31
+ const common : express . RequestHandler = ( req , _ , next ) => {
32
+ // Routes might use these arguments.
33
+ req . args = {
34
+ _ : [ ] ,
35
+ auth : AuthType . None ,
36
+ host : "localhost" ,
37
+ port : 8080 ,
38
+ "proxy-domain" : [ ] ,
39
+ config : "~/.config/code-server/config.yaml" ,
40
+ verbose : false ,
41
+ usingEnvPassword : false ,
42
+ usingEnvHashedPassword : false ,
43
+ "extensions-dir" : "" ,
44
+ "user-data-dir" : "" ,
45
+ }
46
+ next ( )
47
+ }
48
+
49
+ app . use ( common )
50
+ wsApp . use ( common )
51
+
29
52
papi . mount ( app , wsApp )
30
53
app . use ( "/api/applications" , apps . router ( papi ) )
31
54
You can’t perform that action at this time.
0 commit comments