w-web-api 1.0.3 → 1.0.6
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/README.md +16 -22
- package/dist/connecting.svg +10 -0
- package/dist/css/app.ff30ea93.css +1 -0
- package/dist/css/chunk-vendors.f0a39794.css +5 -0
- package/dist/deny.png +0 -0
- package/dist/disconnect.png +0 -0
- package/dist/index.html +1 -0
- package/dist/js/app.584c7442.js +2 -0
- package/dist/js/app.584c7442.js.map +1 -0
- package/dist/js/chunk-vendors.35dfbb6b.js +28 -0
- package/dist/js/chunk-vendors.35dfbb6b.js.map +1 -0
- package/dist/logout.png +0 -0
- package/dist/w-web-api.umd.js +2 -2
- package/dist/w-web-api.umd.js.map +1 -1
- package/docs/WWebApi.html +3 -3
- package/docs/WWebApi.mjs.html +32 -2
- package/docs/index.html +1 -1
- package/package.json +6 -13
- package/server/WWebApi.mjs +31 -1
- package/srv.mjs +2 -2
- package/tableTags-web-api.json +1 -0
- package/toolg/gDistRollup.mjs +5 -3
- package/tableTags.json +0 -1
package/README.md
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
# w-
|
|
1
|
+
# w-web-api
|
|
2
2
|
An operator for orm in server.
|
|
3
3
|
|
|
4
4
|

|
|
5
|
-
[](https://npmjs.org/package/w-web-api)
|
|
6
|
+
[](https://npmjs.org/package/w-web-api)
|
|
7
|
+
[](https://github.com/yuda-lyu/w-web-api)
|
|
8
|
+
[](https://npmjs.org/package/w-web-api)
|
|
9
|
+
[](https://www.jsdelivr.com/package/npm/w-web-api)
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
|
-
To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-
|
|
12
|
+
To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-web-api/WWebApi.html).
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
### Using npm(ES6 module):
|
|
16
|
-
> **Note:** `w-
|
|
16
|
+
> **Note:** `w-web-api` is mainly dependent on `lodash` and `wsemi`.
|
|
17
17
|
|
|
18
18
|
```alias
|
|
19
|
-
npm i w-
|
|
19
|
+
npm i w-web-api
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
#### Example for server:
|
|
23
|
-
> **Link:** [[dev source code](https://github.com/yuda-lyu/w-
|
|
23
|
+
> **Link:** [[dev source code](https://github.com/yuda-lyu/w-web-api/blob/master/srv.mjs)]
|
|
24
24
|
```alias
|
|
25
|
+
import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
|
|
26
|
+
import getSettings from './server/getSettings.mjs'
|
|
25
27
|
import WWebApi from './server/WWebApi.mjs'
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
//st
|
|
29
|
-
let st =
|
|
30
|
-
'dbUsername': 'username',
|
|
31
|
-
'dbPassword': 'password',
|
|
32
|
-
'dbName': 'wapis',
|
|
33
|
-
'dbIP': 'localhost',
|
|
34
|
-
'dbPort': 27017,
|
|
35
|
-
}
|
|
36
|
-
|
|
31
|
+
let st = getSettings()
|
|
37
32
|
|
|
33
|
+
let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}` //使用Mongodb測試
|
|
34
|
+
let db = st.dbName
|
|
38
35
|
let opt = {
|
|
39
36
|
|
|
40
|
-
url: `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}`,
|
|
41
|
-
db: st.dbName,
|
|
42
37
|
getUserById: null,
|
|
43
38
|
bCheckUser: false,
|
|
44
39
|
bExcludeWhenNotAdmin: false,
|
|
@@ -52,9 +47,8 @@ let opt = {
|
|
|
52
47
|
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
|
|
56
50
|
//WWebApi
|
|
57
|
-
WWebApi(opt)
|
|
51
|
+
WWebApi(url, db, WOrm, opt)
|
|
58
52
|
.catch((err) => {
|
|
59
53
|
console.log(err)
|
|
60
54
|
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100px" height="100px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
|
2
|
+
<circle cx="50" cy="50" r="13.8193" fill="none" stroke="#5f2a62" stroke-width="2">
|
|
3
|
+
<animate attributeName="r" repeatCount="indefinite" dur="1.2658227848101264s" values="0;44" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline" begin="-0.6329113924050632s"></animate>
|
|
4
|
+
<animate attributeName="opacity" repeatCount="indefinite" dur="1.2658227848101264s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline" begin="-0.6329113924050632s"></animate>
|
|
5
|
+
</circle>
|
|
6
|
+
<circle cx="50" cy="50" r="35.8165" fill="none" stroke="#a976c3" stroke-width="2">
|
|
7
|
+
<animate attributeName="r" repeatCount="indefinite" dur="1.2658227848101264s" values="0;44" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline"></animate>
|
|
8
|
+
<animate attributeName="opacity" repeatCount="indefinite" dur="1.2658227848101264s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline"></animate>
|
|
9
|
+
</circle>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.md[data-v-6700278b] table{border-collapse:collapse;margin:0;padding:0;word-break:normal}.md[data-v-6700278b] tr{margin:0;padding:0}.md[data-v-6700278b] table tr th{font-weight:700;background:#eee;border:1px solid #ddd;border-bottom:0;margin:0;padding:6px 13px}.md[data-v-6700278b] table tr td{border:1px solid #ddd;margin:0;padding:6px 13px}.md[data-v-6700278b] h1{font-size:1.2rem;line-height:1.2rem}.md[data-v-6700278b] h1,.md[data-v-6700278b] h2{font-weight:700;margin-top:.5rem;margin-bottom:.5rem}.md[data-v-6700278b] h2{font-size:1.1rem;line-height:1.1rem}.md[data-v-6700278b] h3,.md[data-v-6700278b] h4,.md[data-v-6700278b] h5,.md[data-v-6700278b] h6{font-weight:700;font-size:1rem;line-height:1rem;margin-top:.5rem;margin-bottom:.5rem}.bk[data-v-721d333e]{display:inline-block;width:200px;padding:0 10px 10px 0;vertical-align:top}.bk-title[data-v-721d333e]{font-size:.8rem;color:#888}.bk-item[data-v-721d333e]{padding:3px 5px;font-size:.9rem;line-height:.9rem;border-radius:5px;border:1px solid #ddd;background:#fff}body,html{font-family:微軟正黑體,Microsoft JhengHei,MicrosoftJhengHeiRegular,Avenir,Helvetica,Arial,sans-serif;overflow-y:hidden}.v-application,.v-application--wrap,a,button,div,input,p,pre,span,textarea{font-family:inherit}.v-chip{cursor:inherit}.fade-enter-active{-webkit-animation:go 1s;animation:go 1s}.fade-leave-active{-webkit-animation:back 1s;animation:back 1s}@-webkit-keyframes go{0%{opacity:0}to{opacity:1}}@keyframes go{0%{opacity:0}to{opacity:1}}@-webkit-keyframes back{0%{opacity:1}to{opacity:0}}@keyframes back{0%{opacity:1}to{opacity:0}}
|