2020-10-30 07:18:59 +00:00
|
|
|
import * as express from "express"
|
2020-11-04 02:11:14 +00:00
|
|
|
import * as fspath from "path"
|
2020-11-03 22:13:21 +00:00
|
|
|
import * as pluginapi from "../../../typings/pluginapi"
|
2020-10-30 07:18:59 +00:00
|
|
|
|
2020-11-05 04:10:41 +00:00
|
|
|
export const plugin: pluginapi.Plugin = {
|
|
|
|
displayName: "Test Plugin",
|
|
|
|
routerPath: "/test-plugin",
|
|
|
|
homepageURL: "https://example.com",
|
|
|
|
description: "Plugin used in code-server tests.",
|
2020-11-04 02:11:14 +00:00
|
|
|
|
2020-11-05 04:10:41 +00:00
|
|
|
init: (config) => {
|
|
|
|
config.logger.debug("test-plugin loaded!")
|
|
|
|
},
|
2020-10-30 07:18:59 +00:00
|
|
|
|
2020-11-05 04:10:41 +00:00
|
|
|
router: () => {
|
|
|
|
const r = express.Router()
|
|
|
|
r.get("/goland/icon.svg", (req, res) => {
|
|
|
|
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
|
|
|
|
})
|
|
|
|
return r
|
|
|
|
},
|
2020-10-30 07:18:59 +00:00
|
|
|
|
2020-11-05 04:10:41 +00:00
|
|
|
applications: () => {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
name: "Test App",
|
|
|
|
version: "4.0.0",
|
|
|
|
iconPath: "/icon.svg",
|
|
|
|
path: "/test-app",
|
2020-11-04 02:11:14 +00:00
|
|
|
|
2020-11-05 04:10:41 +00:00
|
|
|
description: "This app does XYZ.",
|
|
|
|
homepageURL: "https://example.com",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2020-10-30 07:18:59 +00:00
|
|
|
}
|