File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as express from "express"
2
+ import { PluginAPI } from "../plugin"
3
+
4
+ export function router ( papi : PluginAPI ) : express . Router {
5
+ const router = express . Router ( )
6
+
7
+ router . get ( "/" , async ( req , res ) => {
8
+ res . json ( await papi . applications ( ) )
9
+ } )
10
+
11
+ return router
12
+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import * as proxy from "./pathProxy"
23
23
import * as _static from "./static"
24
24
import * as update from "./update"
25
25
import * as vscode from "./vscode"
26
+ import * as apps from "./apps"
26
27
27
28
declare global {
28
29
// eslint-disable-next-line @typescript-eslint/no-namespace
@@ -118,6 +119,7 @@ export const register = async (
118
119
const papi = new PluginAPI ( logger , process . env . CS_PLUGIN , process . env . CS_PLUGIN_PATH )
119
120
await papi . loadPlugins ( )
120
121
papi . mount ( app )
122
+ app . use ( "/api/applications" , apps . router ( papi ) )
121
123
122
124
app . use ( ( ) => {
123
125
throw new HttpError ( "Not Found" , HttpCode . NotFound )
You can’t perform that action at this time.
0 commit comments