From 0409dd1ce83501b2e091edb9ccbf70e92e89a967 Mon Sep 17 00:00:00 2001 From: Tomasz Gorochowik Date: Tue, 13 Aug 2019 12:34:38 +0200 Subject: [PATCH] Samples: net: civetweb: add README Closes: #18212 Signed-off-by: Tomasz Gorochowik --- samples/net/sockets/civetweb/README.rst | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 samples/net/sockets/civetweb/README.rst diff --git a/samples/net/sockets/civetweb/README.rst b/samples/net/sockets/civetweb/README.rst new file mode 100644 index 00000000000..8d96f9af151 --- /dev/null +++ b/samples/net/sockets/civetweb/README.rst @@ -0,0 +1,48 @@ +.. _sockets-civetweb-sample: + +Civetweb sample +############### + +Overview +******** + +This sample application uses the HTTP APIs provided by the external `Civetweb `_ module to create an HTTP server demonstrating selected Civetweb features. +The Civetweb module is available as a west :ref:`module `. + +The source code for this sample application can be found at: +:zephyr_file:`samples/net/sockets/civetweb`. + +Requirements +************ + +- A board with hardware networking +- The Civetweb module (made available via west) + +Building and Running +******************** + +This sample was tested on the Atmel SAM E70 Xplained board, so this is the recommended target. + +Build it with: + +.. zephyr-app-commands:: + :zephyr-app: samples/net/sockets/civetweb + :board: sam_e70_xplained + :goals: build + :compact: + +The sample application uses a static IP configuration. + +After flashing the board, the server can be accessed with the web browser of your choice at ``10.0.0.111:8080``. + +The sample does not serve any files like HTTP (it does not use any filesystem). +Instead it serves the following three URLs: + +- ``/`` - a basic hello world handler +- ``/info`` - shows OS information, uses the JSON format to achieve that +- ``/history`` - demonstrates the usage of cookies + +A regular 404 status code is returned when trying to access any other URL. + +The IP configuration can be changed in Zephyr config. +The default port can be changed in the sources of the sample.