Embedthis Appweb 3.0A.0
Home > Programming Guide > Embedding Appweb

Quick Nav

Embed the Appweb Library
Creating an Appweb Module

See Also

Embedding Appweb

You should embed the Appweb HTTP library in your main program if any of the following are true:

Linking with the Appweb Library

To link your program with the Appweb library you need to do the following things:
  1. Add  #include "appweb/appweb.h"  to the relevant source files.

  2. Add the Appweb library to your Makefiles and Windows project files. This will mean adding  libappweb.dll on Windows or libappweb.so on Unix.

Redistributing Your Application

When redistributing your application with Appweb embedded, you will need to include the libappweb.dll or libappweb.so library with your distribution.

Creating an Appweb Module

You should embed your code into Appweb as a module if the following are true:

Redistributing Your Module

After you have created your Appweb module, it can be distributed as a single DLL or shared library file. You may wish to include this as part of a larger application or you may want to have Embedthis distribute this on its www.embedthis.com web site from the contributed modules section.


Embedding Appweb

When embedding Appweb in your application or system, you have a three options. You can

When you run the stand-alone Appweb server, you are using Appweb in a manner similar to most other web servers. However, Appweb is uniquely suited for such use in embedded systems. See below for more information.

When you embed libappweb in your application, you extend your application to listen for HTTP requests and thus become a HTTP server. Embedding the Appweb library is easy and requires about a 10-20 programming statements depending on your programming paradigm.

To create an Appweb dynamically loadable module, you need to create a DLL or Unix shared library that contains both your application and some interface code into Appweb. This module is then specified in the Appweb configuration file so that Appweb will load it when initializing. It requires about 20-30 lines of C++ interface code to become an Appweb module.

This document further describes these embedding choices and helps guide you to the best option for your application.

The Appweb Server

The Appweb product comes with a fully featured application that uses the Appweb HTTP library to create a stand-alone server. This HTTP server is installed by default when you install Appweb. This server is ideal for embedded systems as it offers the following features:
Compared to other enterprise servers, Appweb is faster, much smaller and more deterministic in its use of system resources.

On Windows, appweb is capable of running as a Windows Service or as a normal Windows program. The console version will execute within a command window and is often useful for debugging.

You should use the Appweb stand-alone server if the following are true:

As the Appweb server is installed by default, you do not need to do anything extra to start or run it. If you do change the Appweb configuration file, you will need to restart it for your changes to take effect.

Redistributing the Appweb Server

To redistribute the Appweb server, you need to include the following files found under the Appweb installation directory along with any server certificate and authorization password files you may have:

© Embedthis Software LLC, 2003-2009. All rights reserved. Embedthis, Ejscript and Appweb are trademarks of Embedthis Software LLC.