2020-10-30 14:18:59 +07:00
|
|
|
import * as express from "express"
|
2020-11-04 09:11:14 +07:00
|
|
|
import * as fspath from "path"
|
2020-11-04 05:13:21 +07:00
|
|
|
import * as pluginapi from "../../../typings/pluginapi"
|
2020-10-30 14:18:59 +07:00
|
|
|
|
2020-11-05 11:10:41 +07: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 09:11:14 +07:00
|
|
|
|
2020-11-05 11:10:41 +07:00
|
|
|
init: (config) => {
|
|
|
|
config.logger.debug("test-plugin loaded!")
|
|
|
|
},
|
2020-10-30 14:18:59 +07:00
|
|
|
|
2020-11-05 11:10:41 +07: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 14:18:59 +07:00
|
|
|
|
2020-11-05 11:10:41 +07:00
|
|
|
applications: () => {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
name: "Test App",
|
|
|
|
version: "4.0.0",
|
|
|
|
iconPath: "/icon.svg",
|
|
|
|
path: "/test-app",
|
2020-11-04 09:11:14 +07:00
|
|
|
|
2020-11-05 11:10:41 +07:00
|
|
|
description: "This app does XYZ.",
|
|
|
|
homepageURL: "https://example.com",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2020-10-30 14:18:59 +07:00
|
|
|
}
|