Server Setup

While it is completely fine to serve the devices API with flask during development, it should not be done so in production. This section describes how to serve your devices when they are ready to use.

There are two ways to serve a device in production:

  • Run it as a docker container - the image is self-contained, no manual server/uWSGI setup needed.

  • Set it up natively on the server, as described below.

Note

Both ways will make your device publicly available in the network it is connected to.

The skeleton on GitLab provides the necessary files to serve the application with the servers described here. However, you will need to create services and edit configurations of the servers.

Prerequisites

To be able to use the server configurations we provide here, a uWSGI service must be up and running. Before setting up any server see this section to setup the service.

Note

This is only needed for the native setup below - the docker image already bundles uWSGI.

Servers

There are the following servers supported to serve the device API. See the documentation which fits you the most.

You are free to choose any other server which is not listed below, however, it’s recommended to use lighttpd for embedded applications.