The ChirpStack gRPC to REST API proxy exposes the ChirpStack (v4) gRPC as REST API. While the gRPC API interface exposed by ChirpStack (v4) is recommended, in some use-cases a REST API can be more convenient. It could also help when migrating from ChirpStack v3 to v4 as previously this proxy was embedded inside the ChirpStack Application Server.
chirpstack-rest-api --server localhost:8080 --bind 0.0.0.0:8090 --insecure --cors "*"
--server
points to the ChirpStack gRPC endpoint. If ChirpStack is installed on the same machine and uses port8080
(default), you can use the default value. You can also use the environment variableSERVER
.--bind
defines to which interface and port the REST API server will bind. In the above example (and default value), the REST API server will be exposed on port8090
. YOu can also use the environment variableBIND
.--insecure
indicates that the gRPC interface is not secured using a TLS certificate. You can also use the environment variableINSECURE
(setting this to any value enables insecure mode, e.g. do not useINSECURE=false
!).--cors
defines the CORS policy by setting the AllowedOrigins Header. You can also use the environment variableCORS
.--cors "*"
allows all origins. Default is--cors 0.0.0.0
which disables CORS.
Add the ChirpStack repository as described in the Documentation.
After you have added the ChirpStack repository, you can install this component using the following command:
sudo apt install chirpstack-rest-api
Environment variables can be used to configure the ChirpStack REST API proxy.
You will find this configuration in /etc/chirpstack-rest-api/environment
.
sudo systemctl [restart|start|stop] chirpstack-rest-api
Please refer to: https://artifacts.chirpstack.io/downloads/chirpstack-rest-api/.
To start the Docker Compose based development environment:
make devshell
Within this development shell, you can use one of the following commands
(see also the included Makefile
):
# Compile binary
make build
# Create distributable archives and packages.
make dist
# Create snapshot archives and packages.
make snapshot
# Re-generate API definitions (VERSION must be set to the ChirpStack version)
VERSION=v4.0.0 make generate
ChirpStack REST API is distributed under the MIT license. See also LICENSE.