添加public管理
This commit is contained in:
19
src/routes/app-manager/public/list.ts
Normal file
19
src/routes/app-manager/public/list.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { app } from '@/app.ts';
|
||||
import { AppModel } from '../module/index.ts';
|
||||
|
||||
// curl http://localhost:4005/api/router?path=app&key=public-list
|
||||
app
|
||||
.route({
|
||||
path: 'app',
|
||||
key: 'public-list',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const list = await AppModel.findAll({
|
||||
where: {
|
||||
status: 'running',
|
||||
},
|
||||
logging: false,
|
||||
});
|
||||
ctx.body = list;
|
||||
})
|
||||
.addTo(app);
|
||||
Reference in New Issue
Block a user