mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-06-13 01:51:04 +08:00
cross go
This commit is contained in:
@@ -23,11 +23,6 @@ module.exports = {
|
||||
args: ['.', '--env=local'],
|
||||
loadingPage: '/public/html/loading.html',
|
||||
},
|
||||
go: {
|
||||
directory: './go',
|
||||
cmd: 'go',
|
||||
args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073'],
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,22 @@ module.exports = (appInfo) => {
|
||||
messageLog: true
|
||||
};
|
||||
|
||||
/**
|
||||
* Cross-language service
|
||||
* 跨语言服务
|
||||
* 如果有cmd参数,则执行该命令,directory也是必须的
|
||||
*/
|
||||
config.cross = {
|
||||
go: {
|
||||
enable: true,
|
||||
name: 'goapp',
|
||||
cmd: 'go',
|
||||
directory: './go',
|
||||
args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073'],
|
||||
appExit: true,
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
...config
|
||||
};
|
||||
|
||||
@@ -33,6 +33,10 @@ class ExampleController extends Controller {
|
||||
const goEntity = Cross.getProcByName('goapp');
|
||||
Log.info('goEntity name:', goEntity.name);
|
||||
|
||||
Log.info('goEntity config:', goEntity.config);
|
||||
|
||||
Log.info('goEntity args:', goEntity.getArgsObj());
|
||||
|
||||
// const result1 = await Services.get('example').test('electron');
|
||||
// Log.info('service result1:', result1);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "3.9.0",
|
||||
"version": "3.10.0",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user