Browse Source

Added new Embedding manual

Thomas Davis 12 năm trước cách đây
mục cha
commit
cb88a45f25
2 tập tin đã thay đổi với 100 bổ sung2 xóa
  1. 98 0
      Emedding.md
  2. 2 2
      README.md

+ 98 - 0
Emedding.md

@@ -0,0 +1,98 @@
+Embedding Civetweb
+=========
+
+Civetweb is primarily designed so applications can easily add HTTP server functionality.  For example, an application server could use Civetweb to enable a web service interface for automation or remote control.
+
+Files
+------
+
+There is no library, it is just a small set of files to compile in to the application.
+
+#### Required Files
+
+  1. HTTP Server API
+    - civetweb.c
+    - civetweb.h
+  2. MD5 API
+    - md5.h
+    - md5.c
+  3. C++ Wrapper (Optional)
+    - cpp/CivetServer.cpp
+    - cpp/CivetServer.h
+
+#### Other Files
+
+  1. Reference C Server
+    - main.c
+  2. Reference C++ Server
+    - cpp/example.cpp
+
+Quick Start
+------
+
+By default, the server will automatically serve up files liek a normal HTTP server.  An embedded server is most likely going to overload this functionality.
+
+### C
+  - Use mg_start() to start the server.
+  - Use mg_stop() to stop the server.
+  - Use mg_start() options to select the port and document root among other things.
+  - Use mg_start() callbacks to add your own hooks.  The *begin_request* callback is almost always what is needed.
+
+### C++
+  - Create CivetHandlers for each URI.
+  - Register the handlers with CivertServer::addHandler()
+  - CivetServer starts on contruction and stops on destruction.
+  - Use mg_stop() to stop the server.
+  - Use contructor options to select the port and document root among other things.
+  - Use constructor callbacks to add your own hooks.
+
+LUA Support
+------
+
+LUA is a server side include functionality.  Files ending in .la will be processed with LUA.
+
+##### Add the following CFLAGS
+
+  - -DLUA_COMPAT_ALL
+  - -DUSE_LUA
+  - -DUSE_LUA_SQLITE3
+
+##### Add the following sources
+
+  - mod_lua.c
+  - lua-5.2.1/src
+     + lapi.c
+     + lauxlib.c
+     + lbaselib.c
+     + lbitlib.c
+     + lcode.c
+     + lcorolib.c
+     + lctype.c
+     + ldblib.c
+     + ldebug.c
+     + ldo.c
+     + ldump.c
+     + lfunc.c
+     + lgc.c
+     + linit.c
+     + liolib.c
+     + llex.c
+     + lmathlib.c
+     + lmem.c
+     + loadlib.c
+     + lobject.c
+     + lopcodes.c
+     + loslib.c
+     + lparser.c
+     + lstate.c
+     + lstring.c
+     + lstrlib.c
+     + ltable.c
+     + ltablib.c
+     + ltm.c
+     + lundump.c
+     + lvm.c
+     + lzio.c
+  - build/sqlite3.c
+  - build/sqlite3.h
+  - build/lsqlite3.c

+ 2 - 2
README.md

@@ -10,8 +10,8 @@ https://sourceforge.net/projects/civetweb/
 Developers can contribute to CivetWeb via GitHub
 Developers can contribute to CivetWeb via GitHub
 https://github.com/sunsetbrew/civetweb
 https://github.com/sunsetbrew/civetweb
 
 
-Trouble tickets should be filed on SourceForge
-https://sourceforge.net/p/civetweb/tickets/
+Trouble tickets should be filed on GitHub
+https://github.com/sunsetbrew/civetweb/issues
 
 
 Discussion group is at Google Groups
 Discussion group is at Google Groups
 https://groups.google.com/d/forum/civetweb
 https://groups.google.com/d/forum/civetweb