Archived
1
0

Re-export express for plugins

This commit is contained in:
Asher
2021-01-13 16:26:11 -06:00
parent 5f1fab7d27
commit a8e928798b
5 changed files with 13 additions and 372 deletions

View File

@ -1,5 +1,4 @@
import * as cs from "code-server"
import * as express from "express"
import * as fspath from "path"
export const plugin: cs.Plugin = {
@ -13,11 +12,11 @@ export const plugin: cs.Plugin = {
},
router() {
const r = express.Router()
r.get("/test-app", (req, res) => {
const r = cs.express.Router()
r.get("/test-app", (_, res) => {
res.sendFile(fspath.resolve(__dirname, "../public/index.html"))
})
r.get("/goland/icon.svg", (req, res) => {
r.get("/goland/icon.svg", (_, res) => {
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
})
return r