zenitheesc / serverd

A server based on the frameworkd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverd

A server based on the frameworkd

How to run?Dependencies?How to build?How to contribute?

Versão em Portguês

How to run

You can either download the binary on the Releases section, or you can build the project following the steps bellow.

Dependencies

How to build

First you need to install the necessary dependencies. On Debian based systems, you can install with the following command:

sudo apt install cmake nlohmann-json3-dev

For the cpp-httplib you have to clone the repo and follow the instructions on the CMakeLists.txt.

After completing the dependencies, you can build the server with these steps:

mkdir build && cd build
cmake ..
make

To run the server just run:

./bin/Debug/Serverd

To test it you can use curl or any http client.

The server receives JSON's in OBSAT's format, like the example below:

{
	"equipe": 41,
	"bateria": 24,
	"temperatura": 30,
	"pressao": 1,
	"giroscopio": [42,90,30],
	"acelerometro": [10,3,4],
	"payload": {
		"valor1": 3.1415,
		"classe":{
			"array1":[12,123,543],
			"valor2": "string"
		}
	}
}

A simple test can be made following these two steps.

Install curl.

sudo apt install curl

Send a JSON via curl.

curl --data @"<path-to-json>" localhost:8080

The server can accept two argument, the first one is the ip, the default is localhost and the second is the port, the deafult is 8080. You can use the arguments as stated below:

./bin/Debug/Serverd <ip> <port>

How to contribute

We love when new people come and help us to improve our software! If you want to contribute to this project, check our Projects board and pick an idea to develop. When you finish coding, make a clear and descriptive pull request explaining your modifications.

If you find any sort of problem or have a suggestion to the project, please write an issue and we will be pleased to help you!


zenith.eesc@gmail.com

About

A server based on the frameworkd

License:MIT License


Languages

Language:CMake 73.4%Language:C++ 26.6%