Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The RESTAPI of the NextGen device can be used for integration with a web application. A simple example which is build with HTML + JavaScript can be tested here:

https://www.stepoverinfo.net/NG_DEMO/index.html

The source code can be found here:

https://www.stepoverinfo.net/NG_DEMO/NG_demo_v2.zip

You need enter the IP or the hostname of your device. The device needs to be reachable by the client you are using, because the local browser will be in contact with the device and not the external webserver. This has the big advantages that the webserver and the device doesn´t need to inside the same network. The webserver can be inside the cloud and the NextGen Pad can be used without the Ethernet-Kit as local device.

Because of the Cross-Origin Resource Sharing (CORS) there are some requirements.

  • Usage of HTTPS is required, on the webserver and on the device. There for you can not just open the HTML file with your local browser, you need to run it inside a HTTPs environment. The connection to the device needs to be also used with HTTPs (enabled by default on the device)

  • The local browser needs to trust the self signed HTTPs certificate from the device, therefor you need to have our RootCertificate installed on the client system. You can find more information about the installation here.

  • You need to extend the cross origin settings on the device with your own domains, because we restricted the external device access to StepOver Domains. At the moment you can only add other domains by swagger, but WEBGUI option is already planed.

For adding your external domain, you have to open the Swagger page. First you need there to create a new Session. Next you can check the current domains with GET /config function. To change the Domains you need to use PUT /config, where you find a example “Set CORS Origins”. Next you need to Serialize the new config to memory, otherwise the changes are lost after the restart which is required.

cors.mp4

With using * you can set a wildcard to every domain, we recommend to use this only for internal tests and development, because this wildcard means the device will allow the access from every external domain.

image-20240219-105145.png

  • No labels