Skip to end of metadata
Go to start of metadata

This section describes the examples that are related to the HTTP Server module of Micrium OS.

HTTP Server Initialization Example

Description

This is a generic example that shows how to initialize the HTTP Server module. It accomplishes the following tasks:

  • Initialize the HTTP Server module
  • Create a RAM disk for file exchange

Configuration

Mandatory

The following #define must be added in ex_description.h to allow other examples to initialize the HTTP Server module correctly:

#defineDescription
EX_HTTP_SERVER_INIT_AVAILLets the upper example layer know that the HTTP Server Initialization example is present and must be called by other examples.

Location

  • /examples/net/http/server/ex_http_server_init.c
  • /examples/net/http/server/ex_http_server.h

API

API
Description

Ex_HTTP_Server_Init()

Initialize the HTTP Server stack for the example application.

Notes

None.

Simple Server That Uses No File System

Description

This is a simple HTTP server example that demonstrates how to create a web page server without the use of a File System (Micrium OS File System or HTTP static FS).

The web server simply displays a "Hello World!" message on the web page once it is loaded.

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_no_fs.c
  • /examples/net/http/server/ex_http_server_hooks.c
  • /examples/net/http/server/ex_http_server_hooks.h
  • /examples/net/http/server/ex_http_server.h

API

API
Description

Ex_HTTP_Server_InstanceCreateNoFS()

Initializes and starts a basic web server instance.

Basic Server That Uses the HTTP Static File System

Description

This is a basic HTTP server example that demonstrates how to create a web page server using the HTTP server static file system.

The web server displays some web pages and a form once it is loaded.

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_basic_static_fs.c
  • /examples/net/http/server/ex_http_server_hooks.c
  • /examples/net/http/server/ex_http_server_hooks.h
  • /examples/net/http/server/ex_http_server.h
  • The content of the folder /examples/net/http/server/files

API

API
Description

Ex_HTTP_Server_InstanceCreateStaticFS()

Initializes and starts a basic web server instance. Retrieves files from the built-in static file system.

Basic Server That Uses Micrium OS File System

Description

This is a basic HTTP server example that demonstrates how to create a web page server. The functionalities are similar to the "Basic Server that Uses the HTTP static File System" example. However, the web pages are retrieved using Micrium OS File System.

The web server displays some web pages and a form once it is loaded.

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_basic_fs.c
  • /examples/net/http/server/ex_http_server_hooks.c
  • /examples/net/http/server/ex_http_server_hooks.h
  • /examples/net/http/server/ex_http_server.h
  • The content of the folder /examples/net/http/server/files

API

API
Description

Ex_HTTP_Server_InstanceCreateBasic()

Initializes and starts a basic web server instance. Retrieves files from the Micrium OS file system.

Server That Handles REST Requests

Description

This is a simple HTTP server example that demonstrates how to handle REST requests. It uses the HTTP static file system to store the web pages.

The web server displays some web pages and a form once it is loaded. It also offers a form that allows adding entries to a database via REST requests.

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_rest.c
  • /examples/net/http/server/ex_http_server_rest_hooks.c
  • /examples/net/http/server/ex_http_server_rest_hooks.h
  • /examples/net/http/server/ex_http_server.h
  • The content of the folder /examples/net/http/server/files

API

API
Description

Ex_HTTP_Server_InstanceCreateREST()

Initialize HTTPs REST Example application.


Server That Handles Webpages, REST Requests and Authentication Support

Description

This is an HTTP server example that demonstrates how to handle web pages, RESTrequestsand authentication in a single instance. It requires the use of the Control Layer. It uses the HTTP static file system to store the web pages.

The web server displays some web pages and a form once it is loaded. It also offers a form that allows adding entries to a database via REST requests.

Note that you will have to login first before accessing the pages. The example will create the following user accounts:

Usernameadminuser0user1
Passwordpassword<empty>user1
RightsManager of HTTP user access rightHTTP userHTTP user

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_ctrl_layer.c
  • /examples/net/http/server/ex_http_server_rest_hooks.c
  • /examples/net/http/server/ex_http_server_rest_hooks.h
  • /examples/net/http/server/ex_http_server.h
  • The content of the folder /examples/net/http/server/files

API

API
Description

Ex_HTTP_Server_InstanceCreateCtrlLayer()

Initialize HTTPs REST Example application.

Basic Secure Server That Uses SSL-TLS and the HTTP Static File System

Description

This is a basic HTTP server example that demonstrates how to create asecurewebserverusingSSL-TLS and the HTTP server static file system.

The web server displays some web pages and a form once it is loaded.

Configuration

None.

Location

  • /examples/net/http/server/ex_http_server_ssl_tls_static_fs.c
  • /examples/net/http/server/ex_http_server_hooks.c
  • /examples/net/http/server/ex_http_server_hooks.h
  • /examples/net/http/server/ex_http_server.h
  • The content of the folder /examples/net/http/server/files

API

API
Description

Ex_HTTP_Server_InstanceCreateSecure()

Initialize HTTPs REST Example application.