Skip to content

Commit af73b96

Browse files
committed
routes/apps.ts: Add example output
1 parent 2a13d00 commit af73b96

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

‎src/node/routes/apps.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { PluginAPI } from "../plugin"
33

44
/**
55
* Implements the /api/applications endpoint
6+
*
7+
* See typings/pluginapi.d.ts for details.
68
*/
79
export function router(papi: PluginAPI): express.Router {
810
const router = express.Router()

‎typings/pluginapi.d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,38 @@ import * as express from "express"
4242
*
4343
* If two plugins are found with the exact same name, then code-server will
4444
* use the first one and emit a warning.
45+
*
46+
*/
47+
48+
/* Programmability
4549
*
4650
* There is also a /api/applications endpoint to allow programmatic access to all
4751
* available applications. It could be used to create a custom application dashboard
4852
* for example. An important difference with the API is that all application paths
4953
* will be absolute (i.e have the plugin path prepended) so that they may be used
5054
* directly.
55+
*
56+
* Example output:
57+
*
58+
* [
59+
* {
60+
* "name": "Test App",
61+
* "version": "4.0.0",
62+
* "iconPath": "/test-plugin/test-app/icon.svg",
63+
* "path": "/test-plugin/test-app",
64+
* "description": "This app does XYZ.",
65+
* "homepageURL": "https://example.com",
66+
* "plugin": {
67+
* "name": "test-plugin",
68+
* "version": "1.0.0",
69+
* "modulePath": "/Users/nhooyr/src/cdr/code-server/test/test-plugin",
70+
* "displayName": "Test Plugin",
71+
* "description": "Plugin used in code-server tests.",
72+
* "routerPath": "/test-plugin",
73+
* "homepageURL": "https://example.com"
74+
* }
75+
* }
76+
* ]
5177
*/
5278

5379
/**

0 commit comments

Comments
 (0)