"feat: 新增远程应用测试脚本,升级 pm2 依赖"
This commit is contained in:
17
assistant/src/test/common.ts
Normal file
17
assistant/src/test/common.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// import { assistantConfig } from '../app.ts';
|
||||
// import { RemoteApp } from '@/module/assistant/remote-app/remote-app.ts';
|
||||
console.log('assistantConfig');
|
||||
// console.log('assistantConfig', assistantConfig);
|
||||
// const main = async () => {
|
||||
// const app = new RemoteApp({
|
||||
// assistantConfig,
|
||||
// });
|
||||
// const connect = await app.isConnect();
|
||||
// if (connect) {
|
||||
// console.log('Connected to assistant');
|
||||
// } else {
|
||||
// console.log('Not connected to assistant');
|
||||
// }
|
||||
// };
|
||||
|
||||
// main();
|
||||
20
assistant/src/test/remote-app.ts
Normal file
20
assistant/src/test/remote-app.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { logger } from '@/module/logger.ts';
|
||||
import { assistantConfig, app } from '../app.ts';
|
||||
import '../routes/index.ts';
|
||||
import { RemoteApp } from '@/module/assistant/remote-app/remote-app.ts';
|
||||
const main = async () => {
|
||||
assistantConfig.checkMounted();
|
||||
const remoteApp = new RemoteApp({
|
||||
assistantConfig,
|
||||
app,
|
||||
});
|
||||
const connect = await remoteApp.isConnect();
|
||||
if (connect) {
|
||||
console.log('Connected to proxy server');
|
||||
remoteApp.listenProxy();
|
||||
} else {
|
||||
console.log('Not connected to proxy server');
|
||||
}
|
||||
};
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user