2020-11-04 02:14:14 +00:00
|
|
|
import * as express from "express"
|
|
|
|
import { PluginAPI } from "../plugin"
|
|
|
|
|
2020-11-04 02:14:19 +00:00
|
|
|
/**
|
|
|
|
* Implements the /api/applications endpoint
|
2020-11-04 02:49:10 +00:00
|
|
|
*
|
|
|
|
* See typings/pluginapi.d.ts for details.
|
2020-11-04 02:14:19 +00:00
|
|
|
*/
|
2020-11-04 02:14:14 +00:00
|
|
|
export function router(papi: PluginAPI): express.Router {
|
|
|
|
const router = express.Router()
|
|
|
|
|
|
|
|
router.get("/", async (req, res) => {
|
|
|
|
res.json(await papi.applications())
|
|
|
|
})
|
2020-11-04 02:53:16 +00:00
|
|
|
|
2020-11-04 02:14:14 +00:00
|
|
|
return router
|
|
|
|
}
|