@steedos/service-api 2.5.3-beta.16 → 2.5.3-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -30
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -13,8 +13,6 @@ const {
|
|
|
13
13
|
const SteedosRouter = require('@steedos/router');
|
|
14
14
|
const _ = require('lodash');
|
|
15
15
|
const ServiceObjectGraphql = require('@steedos/service-object-graphql')
|
|
16
|
-
const open = require('open');
|
|
17
|
-
|
|
18
16
|
|
|
19
17
|
const mixinOptions = {
|
|
20
18
|
|
|
@@ -92,7 +90,6 @@ const mixinOptions = {
|
|
|
92
90
|
*/
|
|
93
91
|
module.exports = {
|
|
94
92
|
name: "api",
|
|
95
|
-
projectStarted: false,
|
|
96
93
|
mixins: [ApiGateway,
|
|
97
94
|
// GraphQL Apollo Server
|
|
98
95
|
ApolloService(mixinOptions),
|
|
@@ -732,30 +729,6 @@ module.exports = {
|
|
|
732
729
|
created() {
|
|
733
730
|
this.app = SteedosRouter.staticRouter();
|
|
734
731
|
},
|
|
735
|
-
events:{
|
|
736
|
-
'service-ui.started': function(){
|
|
737
|
-
this.app.use("/", this.express());
|
|
738
|
-
},
|
|
739
|
-
"$packages.changed": function(){
|
|
740
|
-
if (!this.projectStarted) {
|
|
741
|
-
this.projectStarted = true
|
|
742
|
-
// 开发环境, 显示耗时
|
|
743
|
-
if(process.env.NODE_ENV == 'development' && global.__startDate){
|
|
744
|
-
console.log('耗时: ' + (new Date().getTime() - global.__startDate.getTime()) + ' ms');
|
|
745
|
-
}
|
|
746
|
-
console.log(`Project is running at ${process.env.ROOT_URL}`);
|
|
747
|
-
console.log('');
|
|
748
|
-
if (process.env.STEEDOS_AUTO_OPEN_BROWSER != 'false') { // 默认打开,如果不想打开,设置STEEDOS_AUTO_OPEN_BROWSER=false
|
|
749
|
-
try {
|
|
750
|
-
open(process.env.ROOT_URL);
|
|
751
|
-
} catch (error) {
|
|
752
|
-
console.error(error);
|
|
753
|
-
console.error('auto open browser failed.');
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
732
|
async started() {
|
|
760
733
|
|
|
761
734
|
this.broker.createService(require("@steedos/service-ui"));
|
|
@@ -772,9 +745,9 @@ module.exports = {
|
|
|
772
745
|
// });
|
|
773
746
|
// }
|
|
774
747
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
748
|
+
this.broker.waitForServices('~packages-@steedos/service-ui').then(() => {
|
|
749
|
+
this.app.use("/", this.express());
|
|
750
|
+
})
|
|
778
751
|
|
|
779
752
|
global.SteedosApi = {
|
|
780
753
|
express: this.express
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-api",
|
|
3
|
-
"version": "2.5.3-beta.
|
|
3
|
+
"version": "2.5.3-beta.19",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@steedos/auth": "2.5.3-beta.
|
|
8
|
-
"@steedos/router": "2.5.3-beta.
|
|
9
|
-
"@steedos/service-object-graphql": "2.5.3-beta.
|
|
10
|
-
"@steedos/service-ui": "2.5.3-beta.
|
|
7
|
+
"@steedos/auth": "2.5.3-beta.19",
|
|
8
|
+
"@steedos/router": "2.5.3-beta.19",
|
|
9
|
+
"@steedos/service-object-graphql": "2.5.3-beta.19",
|
|
10
|
+
"@steedos/service-ui": "2.5.3-beta.19",
|
|
11
11
|
"graphql": "^15.8.0",
|
|
12
12
|
"graphql-iso-date": "^3.6.1",
|
|
13
13
|
"graphql-type-json": "^0.3.2",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "43f6afa6a823ae9f34be22b981a6fa38fd5590e2"
|
|
23
23
|
}
|