w-web-api 1.0.17 → 1.0.18

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/docs/WWebApi.html CHANGED
@@ -59,7 +59,7 @@
59
59
 
60
60
 
61
61
 
62
- <h4 class="name" id="WWebApi"><span class="type-signature">(async) </span>new WWebApi<span class="signature">(WOrm, url, db, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
62
+ <h4 class="name" id="WWebApi"><span class="type-signature"></span>new WWebApi<span class="signature">(WOrm, url, db, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
63
63
 
64
64
 
65
65
 
@@ -71,7 +71,7 @@
71
71
 
72
72
  <dt class="tag-source">Source:</dt>
73
73
  <dd class="tag-source"><ul class="dummy"><li>
74
- <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line68">line 68</a>
74
+ <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line69">line 69</a>
75
75
  </li></ul></dd>
76
76
 
77
77
 
@@ -124,7 +124,7 @@
124
124
 
125
125
  <h5>Example</h5>
126
126
 
127
- <pre class="prettyprint"><code>import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
128
127
  getUserById: null,
129
128
  bCheckUser: false,
130
129
  bExcludeWhenNotAdmin: false,
131
130
  serverPort: 11005,
132
131
  webName: {
133
132
  'eng': 'API Service',
134
133
  'cht': 'API管理系統'
135
134
  },
136
135
  .catch((err) => {
137
136
  console.log(err)
138
137
  })</code></pre>
138
+ <pre class="prettyprint"><code>import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
139
139
  getUserById: null,
140
140
  bCheckUser: false,
141
141
  bExcludeWhenNotAdmin: false,
142
142
  serverPort: 11005,
143
143
  webName: {
144
144
  'eng': 'API Service',
145
145
  'cht': 'API管理系統'
146
146
  },
147
147
  console.log(err)
148
148
 
149
149
 
150
150
 
@@ -604,7 +604,7 @@
604
604
  <br class="clear">
605
605
 
606
606
  <footer>
607
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 16:16:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
607
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 17:00:10 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
608
608
  </footer>
609
609
 
610
610
  <script>prettyPrint();</script>
@@ -103,13 +103,14 @@ import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
103
103
  * }
104
104
  *
105
105
  * //WWebApi
106
- * WWebApi(WOrm, url, db, opt)
107
- * .catch((err) => {
108
- * console.log(err)
109
- * })
106
+ * let instWWebApi = WWebApi(WOrm, url, db, opt)
107
+ *
108
+ * instWWebApi.on('error', (err) => {
109
+ * console.log(err)
110
+ * })
110
111
  *
111
112
  */
112
- async function WWebApi(WOrm, url, db, opt = {}) {
113
+ function WWebApi(WOrm, url, db, opt = {}) {
113
114
  let instWServHapiServer = null
114
115
 
115
116
 
@@ -363,7 +364,7 @@ async function WWebApi(WOrm, url, db, opt = {}) {
363
364
 
364
365
 
365
366
  //WServHapiServer
366
- instWServHapiServer = WServHapiServer({
367
+ instWServHapiServer = new WServHapiServer({
367
368
  port: opt.serverPort,
368
369
  pathStaticFiles,
369
370
  apis,
@@ -406,7 +407,7 @@ export default WWebApi
406
407
  <br class="clear">
407
408
 
408
409
  <footer>
409
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 16:16:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
410
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 17:00:10 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
410
411
  </footer>
411
412
 
412
413
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -68,7 +68,7 @@
68
68
  <br class="clear">
69
69
 
70
70
  <footer>
71
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 16:16:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
71
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 19 2022 17:00:10 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
72
72
  </footer>
73
73
 
74
74
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-web-api",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "main": "dist/w-web-api.umd.js",
5
5
  "dependencies": {
6
6
  "@mdi/js": "^6.6.96",
@@ -9,7 +9,7 @@
9
9
  "showdown": "^2.0.3",
10
10
  "w-component-vue": "^2.2.6",
11
11
  "w-data-collector": "^1.0.13",
12
- "w-serv-hapi": "^1.0.8",
12
+ "w-serv-hapi": "^1.0.9",
13
13
  "w-serv-orm": "^1.0.2",
14
14
  "wsemi": "^1.6.57"
15
15
  },
@@ -59,13 +59,14 @@ import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
59
59
  * }
60
60
  *
61
61
  * //WWebApi
62
- * WWebApi(WOrm, url, db, opt)
63
- * .catch((err) => {
64
- * console.log(err)
65
- * })
62
+ * let instWWebApi = WWebApi(WOrm, url, db, opt)
63
+ *
64
+ * instWWebApi.on('error', (err) => {
65
+ * console.log(err)
66
+ * })
66
67
  *
67
68
  */
68
- async function WWebApi(WOrm, url, db, opt = {}) {
69
+ function WWebApi(WOrm, url, db, opt = {}) {
69
70
  let instWServHapiServer = null
70
71
 
71
72
 
@@ -319,7 +320,7 @@ async function WWebApi(WOrm, url, db, opt = {}) {
319
320
 
320
321
 
321
322
  //WServHapiServer
322
- instWServHapiServer = WServHapiServer({
323
+ instWServHapiServer = new WServHapiServer({
323
324
  port: opt.serverPort,
324
325
  pathStaticFiles,
325
326
  apis,
package/srv.mjs CHANGED
@@ -29,10 +29,11 @@ let opt = {
29
29
  }
30
30
 
31
31
  //WWebApi
32
- WWebApi(WOrm, url, db, opt)
33
- .catch((err) => {
34
- console.log(err)
35
- })
32
+ let instWWebApi = WWebApi(WOrm, url, db, opt)
33
+
34
+ instWWebApi.on('error', (err) => {
35
+ console.log(err)
36
+ })
36
37
 
37
38
 
38
39
  //node --experimental-modules --es-module-specifier-resolution=node srv.mjs
@@ -1 +1 @@
1
- {"apis":"RnCO2r"}
1
+ {"apis":"E90dfN"}