You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "encryptKey" field is a user-defined keyword/password used to encrypt/decrypt the users passwords during authentication procedures.
@@ -244,57 +249,115 @@ RESPONSE:
244
249
245
250
246
251
## API documentation management
247
-
IoTronic releases its APIs documentation by means of Swagger framework. In particular we used ["swagger-jsdoc"](https://www.npmjs.com/package/swagger-jsdoc) and ["swagger-ui"](https://swagger.io/swagger-ui/) respectively to describe each RESTful API in the source code and publish the produced documentation.
252
+
IoTronic releases its APIs documentation by means of Swagger framework. In particular we used ["swagger-jsdoc"](https://www.npmjs.com/package/swagger-jsdoc) and ["swagger-ui"](https://swagger.io/swagger-ui/)
253
+
respectively to describe each RESTful API in the source code and publish the produced documentation.
248
254
249
-
To use swagger-ui we need to clone the git repository from [here](https://github.com/swagger-api/swagger-ui)
250
-
and move the "dist" folder where you prefer and specify it inside the "settings.json" configuration file
251
-
as showed below:
255
+
Iotronic is able to expose the documentation:
256
+
1. embedded mode: generate and expose runtime the API documentation
257
+
2. exposed mode: only specify the URLs of the web-server that is exposing the documentation
252
258
259
+
In both cases we need to get the "swagger-ui" cloning the git repository from [here](https://github.com/swagger-api/swagger-ui)
260
+
and rename the "dist/" folder in "iotronic-api-docs/".
261
+
262
+
#### 1. Embedded mode
253
263
```
254
264
"docs": {
255
-
"enable": [ true | false ],
256
-
"path": "<SWAGGER-DIST-PATH>"
265
+
266
+
"embedded":{
267
+
"enable": true,
268
+
"path": "<SWAGGER-DIST-PATH>"
269
+
},
270
+
"exposed":{
271
+
"enable": false,
272
+
"url":"",
273
+
"url_spec":""
274
+
}
257
275
258
276
}
277
+
259
278
```
279
+
We have to move the "iotronic-api-docs/" folder in the "/var/lib/iotronic/docs/" and we need to specify it inside the
280
+
"settings.json" configuration file, as showed above, in the "path" section substituting "<SWAGGER-DIST-PATH>" variable
281
+
and setting to "true" the "enable" flag in the "embedded" section.
260
282
261
-
You have to edit the "index.html" in <SWAGGER-DIST-PATH> as described in the [official guide](https://swagger.io/docs/swagger-tools/#download-33):
[Link to Official guide](https://swagger.io/docs/swagger-tools/#download-33)
344
+
345
+
346
+
286
347
287
348
#### Standalone API management
288
-
We also provided a NodeJS script ([iotronic-docs-gen.js](iotronic-docs-gen.js)) to do that without using directly IoTronic (we need to set "enable" to false). This script will generate the documentation and will publish it by means of "swagger-ui".
349
+
We also provided a NodeJS script ([iotronic-docs-gen.js](iotronic-docs-gen.js)) to do that without using directly
350
+
IoTronic or a web-server. This script will generate the documentation and will publish it by means of "swagger-ui".
- -e, --embedded true | false to spawn API webpage documentation; if "false" the "iotronic-swagger.json" will be created in the <SWAGGER-DIST-PATH> folder specified in the "settings.json" file in the "docs" section.
297
359
- -p, --port [only with --embedded=true] Listening port. (this port has to be different from the ports used by IoTronic "http(s)_port")
360
+
- -w, --web Web server path: where will be created the swagger json file "iotronic-swagger.json".
The "encryptKey" field is a user-defined keyword/password used to encrypt/decrypt the users passwords during authentication procedures.
@@ -249,57 +256,115 @@ RESPONSE:
249
256
250
257
251
258
## API documentation management
252
-
IoTronic releases its APIs documentation by means of Swagger framework. In particular we used ["swagger-jsdoc"](https://www.npmjs.com/package/swagger-jsdoc) and ["swagger-ui"](https://swagger.io/swagger-ui/) respectively to describe each RESTful API in the source code and publish the produced documentation.
259
+
IoTronic releases its APIs documentation by means of Swagger framework. In particular we used ["swagger-jsdoc"](https://www.npmjs.com/package/swagger-jsdoc) and ["swagger-ui"](https://swagger.io/swagger-ui/)
260
+
respectively to describe each RESTful API in the source code and publish the produced documentation.
253
261
254
-
To use swagger-ui we need to clone the git repository from [here](https://github.com/swagger-api/swagger-ui)
255
-
and move the "dist" folder where you prefer and specify it inside the "settings.json" configuration file
256
-
as showed below:
262
+
Iotronic is able to expose the documentation:
263
+
1. embedded mode: generate and expose runtime the API documentation
264
+
2. exposed mode: only specify the URLs of the web-server that is exposing the documentation
257
265
266
+
In both cases we need to get the "swagger-ui" cloning the git repository from [here](https://github.com/swagger-api/swagger-ui)
267
+
and rename the "dist/" folder in "iotronic-api-docs/".
268
+
269
+
#### 1. Embedded mode
258
270
```
259
271
"docs": {
260
-
"enable": [ true | false ],
261
-
"path": "<SWAGGER-DIST-PATH>"
272
+
273
+
"embedded":{
274
+
"enable": true,
275
+
"path": "<SWAGGER-DIST-PATH>"
276
+
},
277
+
"exposed":{
278
+
"enable": false,
279
+
"url":"",
280
+
"url_spec":""
281
+
}
262
282
263
283
}
284
+
264
285
```
286
+
We have to move the "iotronic-api-docs/" folder in the "/var/lib/iotronic/docs/" and we need to specify it inside the
287
+
"settings.json" configuration file, as showed above, in the "path" section substituting "<SWAGGER-DIST-PATH>" variable
288
+
and setting to "true" the "enable" flag in the "embedded" section.
265
289
266
-
You have to edit the "index.html" in <SWAGGER-DIST-PATH> as described in the [official guide](https://swagger.io/docs/swagger-tools/#download-33):
[Link to Official guide](https://swagger.io/docs/swagger-tools/#download-33)
351
+
352
+
353
+
291
354
292
355
#### Standalone API management
293
-
We also provided a NodeJS script ([iotronic-docs-gen.js](iotronic-docs-gen.js)) to do that without using directly IoTronic (we need to set "enable" to false). This script will generate the documentation and will publish it by means of "swagger-ui".
356
+
We also provided a NodeJS script ([iotronic-docs-gen.js](iotronic-docs-gen.js)) to do that without using directly
357
+
IoTronic or a web-server. This script will generate the documentation and will publish it by means of "swagger-ui".
- -e, --embedded true | false to spawn API webpage documentation; if "false" the "iotronic-swagger.json" will be created in the <SWAGGER-DIST-PATH> folder specified in the "settings.json" file in the "docs" section.
302
366
- -p, --port [only with --embedded=true] Listening port. (this port has to be different from the ports used by IoTronic "http(s)_port")
367
+
- -w, --web Web server path: where will be created the swagger json file "iotronic-swagger.json".
0 commit comments