code-server/test/test-plugin/src/index.ts

32 lines
774 B
TypeScript
Raw Normal View History

import * as express from "express"
import * as fspath from "path"
import * as pluginapi from "../../../typings/pluginapi"
export const displayName = "Test Plugin"
export const path = "/test-plugin"
export const description = "Plugin used in code-server tests."
export function init(config: pluginapi.PluginConfig) {
config.logger.debug("test-plugin loaded!")
}
export function router(): express.Router {
const r = express.Router()
r.get("/goland/icon.svg", (req, res) => {
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
})
return r
}
export function applications(): pluginapi.Application[] {
2020-10-30 07:26:30 +00:00
return [
{
name: "Test App",
2020-10-30 07:26:30 +00:00
version: "4.0.0",
iconPath: "/icon.svg",
description: "This app does XYZ.",
2020-10-30 07:26:30 +00:00
},
]
}