diff --git a/doc/readme.md b/doc/readme.md
new file mode 100644
index 0000000..26e5c0b
--- /dev/null
+++ b/doc/readme.md
@@ -0,0 +1,10 @@
+Welcome to the EiffelWeb framework documentation.
+
+The EiffelWeb framework is also known as *EWF*.
+
+The [Workbook](/doc/workbook/workbook.md) lets you discover the EiffelWeb framework.
+
+And you may found in the *old* [Wiki](/doc/wiki/readme.md) notes that were not migrated to the [Workbook](/doc/workbook/workbook.md), but consider them as obsolete.
+
+[Enter the documentation](/doc/workbook/workbook.md)
+
diff --git a/doc/wiki/Spec-server-architecture.md b/doc/wiki/Spec-server-architecture.md
index 2960af9..e44f4de 100644
--- a/doc/wiki/Spec-server-architecture.md
+++ b/doc/wiki/Spec-server-architecture.md
@@ -1,3 +1,3 @@
## Diagram: Overview of the server architecture ##
-
\ No newline at end of file
+
diff --git a/doc/workbook/basics/basics.md b/doc/workbook/basics/basics.md
index f570644..698878b 100644
--- a/doc/workbook/basics/basics.md
+++ b/doc/workbook/basics/basics.md
@@ -1,4 +1,4 @@
-Nav: [Workbook](../workbook.md) | [Handling Requests: Form/Query Parameter](/doc/workbook/handling_request/form.md)
+Nav: [Workbook](../workbook.md) :: [Handling Requests: Form/Query Parameter](../handling_request/form.md)
## EWF basic service
@@ -11,14 +11,15 @@ Nav: [Workbook](../workbook.md) | [Handling Requests: Form/Query Parameter](/doc
- [Source code](#source_2)
-
+
+
## EWF service structure
The following code describes the basic structure of an EWF basic service that handles HTTP requests. We will need to define a Service Launcher and a Request Execution implementation.
```eiffel
class
- APPLICACTION
+ APPLICATION
inherit
WSF_DEFAULT_SERVICE [APPLICATION_EXECUTION]
@@ -91,16 +92,15 @@ The **WSF_RESPONSE** provides features to define the response with information s
**APPLICATION** is the root class of our example, it launches the application, using the corresponding connector, Which connector? this depends how you want to run it cgi, fcgi,nino or standalone. For development is recommended to use a standalone web server written in Eiffel, and run the execution within the EiffelStudio debugger. For production fcgi (or cgi) using Apache or another popular web server.
-
+
-**WS_LAUNCHABLE_SERVICE** inherit from **WS_SERVICE** class, which is a marker interface in EWF. And also provides a way to launch our application using different kind of connectors. The class **WSF_DEFAULT_SERVICE_I**, inherit from **WS_LAUNCHABLE_SERVICE** and has a formal generic that should conform to **WSF_SERVICE_LAUNCHER [WSF_EXECUTION]**. Below a [BON diagram] (http://www.bon-method.com/index_normal.htm) showing one of the possible options.
+**WS_LAUNCHABLE_SERVICE** inherit from **WS_SERVICE** class, which is a marker interface in EWF. And also provides a way to launch our application using different kind of connectors. The class **WSF_DEFAULT_SERVICE_I**, inherit from **WS_LAUNCHABLE_SERVICE** and has a formal generic that should conform to **WSF_SERVICE_LAUNCHER [WSF_EXECUTION]**. Below a [BON diagram](http://www.bon-method.com/index_normal.htm) showing one of the possible options.
-
+
Other connectors:
**WSF_STANDALONE_SERVICE_LAUNCHER**
**WSF_CGI_SERVICE_LAUNCHER**
-**WSF_NINO_SERVICE_LAUNCHER**
**WSF_LIBFCGI_SERVICE_LAUNCHER**
A basic EWF service inherits from **WSF_DEFAULT_SERVICE**, which has a formal generic that should conform to **WSF_EXECUTION** class with a `make' creation procedure, in our case the class **APPLICATION_EXECUTION**.
@@ -109,11 +109,12 @@ The **APPLICATION_EXECUTION** class inherits from **WSF_EXECUTION** interface,
In the **APPLICATION_EXECUTION** class class you will need to implement implement the **execute** feature, get data from the request *req* and write the response in *res*.
-
+
The WSF_EXECUTION instance, in this case ```APPLICATION_EXECUTION``` is created per request, with two main attributes request: ```WSF_REQUEST``` and response: ```WSF_RESPONSE```.
-
+
+
## A simple Service to Generate Plain Text.
Before to continue, it is recommended to review the getting started guided. In the example we will only shows the implementation of the WSF_EXECUTION interface.
@@ -142,16 +143,18 @@ end
```
-##### Source code
+
+### Source code
The source code is available on Github. You can get it by running the command:
```git clone https://github.com/EiffelWebFramework/ewf.git```
-The example of simple service that generate plain text response is located in the directory $PATH/ewd/doc/workbook/basics/simple, where $PATH is where you run ```git clone``` . Just double click on the simple.ecf file and select the simple_nino target or if you prefer the command line, run the command:
+The example of simple service that generate plain text response is located in the directory $PATH/ewf/doc/workbook/basics/simple, where $PATH is where you run ```git clone``` . Just double click on the simple.ecf file and select the simple_nino target or if you prefer the command line, run the command:
```estudio -config simple.ecf -target simple_nino```
+
## A Service to Generate HTML.
To generate HTML, it's needed
@@ -193,7 +196,10 @@ feature -- Basic operations
end
```
-##### Source code
+
+
+
+### Source code
The source code is available on Github. You can get it by running the command:
```git clone https://github.com/EiffelWebFramework/ewf.git```
@@ -202,5 +208,5 @@ The example of the service that generates HTML is located in the directory $PATH
```estudio -config simple_html.ecf -target simple_html_nino```
-Nav: [Workbook](../workbook.md) | [Handling Requests: Form/Query Parameter](/doc/workbook/handling_request/form.md)
+Nav: [Workbook](../workbook.md) :: [Handling Requests: Form/Query Parameter](../handling_request/form.md)
diff --git a/doc/workbook/basics/simple_html/apache_config/Readme.md b/doc/workbook/basics/simple_html/apache_config/Readme.md
index 448eb14..c2fd077 100644
--- a/doc/workbook/basics/simple_html/apache_config/Readme.md
+++ b/doc/workbook/basics/simple_html/apache_config/Readme.md
@@ -1,31 +1,32 @@
-##Run simple_html example on Apache with FCGI on Windows.
+Nav: [Workbook](../../../workbook.md) :: [Basic concepts](../../../basics/basics.md)
+## Run simple_html example on Apache with FCGI on Windows.
-####Prerequisites
+#### Prerequisites
* This tutorial was written for people working under Windows environment, and using Apache Server with FCGI connector
* Compile the ewf application from command line.
-* Assuming you have installed Apache Server under C:/home/server/Apache24.
-* Assuming you have placed your current project under C:/home/server/Apache24/fcgi-bin.
-* Assuming you have setted the Listen to 8888, the defautl value is 80 .
+* Assuming you have installed Apache Server under `C:/home/server/Apache24`.
+* Assuming you have placed your current project under `C:/home/server/Apache24/fcgi-bin`.
+* Assuming you have setted the Listen to `8888`, the defautl value is `80` .
-####FCGI module
+#### FCGI module
If you don't have the FCGI module installed, you can get it from https://www.apachelounge.com/download/, download the module based on your platform [modules-2.4-win64-VC11.zip](https://www.apachelounge.com/download/VC11/modules/modules-2.4-win64-VC11.zip) or [modules-2.4-win32-VC11.zip](https://www.apachelounge.com/download/VC11/modules/modules-2.4-win32-VC11.zip), uncompress it
-and copy the _mod_fcgid.so_ to C:/home/server/Apache24/modules
+and copy the _mod_fcgid.so_ to `C:/home/server/Apache24/modules`
-####Compile the project simple_html using the fcgi connector.
+#### Compile the project simple_html using the fcgi connector.
ec -config simple_html.ecf -target simple_html_fcgi -finalize -c_compile -project_path .
-Copy the genereted exe to C:/home/server/Apache24/fcgi-bin folder.
+Copy the genereted exe to `C:/home/server/Apache24/fcgi-bin` folder.
Check if you have _libfcgi.dll_ in your PATH.
-####Apache configuration
+#### Apache configuration
Add to httpd.conf the content, you can get the configuration file [here](config.conf)
```
@@ -43,10 +44,18 @@ LoadModule fcgid_module modules/mod_fcgid.so
```
Test if your httpd.conf is ok
->httpd -t
+```
+> httpd -t
+```
-Luanch the server
->httpd
+Launch the server
+```
+> httpd
+```
Check the application
->http://localhost:8888/simple
+```
+> http://localhost:8888/simple
+```
+
+Nav: [Workbook](../../../workbook.md) :: [Basic concepts](../../../basics/basics.md)
diff --git a/doc/workbook/basics/simple_html/simple_html.rc b/doc/workbook/basics/simple_html/simple_html.rc
deleted file mode 100644
index b0ec159..0000000
--- a/doc/workbook/basics/simple_html/simple_html.rc
+++ /dev/null
@@ -1,6 +0,0 @@
-#include
-
-STRINGTABLE
-BEGIN
- 1 "This Program was made using EiffelStudio using Visual Studio C++"
-END
diff --git a/doc/workbook/deployment.md b/doc/workbook/deployment.md
deleted file mode 100644
index 3f86da9..0000000
--- a/doc/workbook/deployment.md
+++ /dev/null
@@ -1,163 +0,0 @@
-EWF Deployment
-==============
-
-#Apache on Windows#
-
-1. Apache Install
-2. Deploying EWF CGI
-3. CGI overview
- 1. Build EWF application
- 2. Copy the generated exe file and the www content .htaccess CGI
-4. Deploying EWF FCGI
-5. FCGI overview
- 1. Build EWF application
- 2. Copy the generated exe file and the www content.htaccess CGI
-
-
-
-##Apache on Windows
-
-###Apache Install
-
->Check the correct version (Win 32 or Win64)
->Apache Version: Apache 2.4.4
->Windows: http://www.apachelounge.com/download/
-
-####Deploying EWF CGI
-
-####CGI overview
->A new process is started for each HTTP request. So if there are N requests to the same >CGI program, the code of the CGI program is loaded into memory N times.
->When a CGI program finishes handling a request, the program terminates.
-
-* Build EWF application
-
- ec -config [app.ecf] -target [app_cgi] -finalize -c_compile -project_path
-
-
->Note: change app.ecf and target app_cgi based on your own configuration.
-
-* Copy the generated exe file and the www content
-
-Copy the app.exe and the folder _www_ into a folder served by apache2, for example under.
-
-
- /htdocs.
-
- = path to your apache installation
-
- Edit httpd.conf under c://conf
-
- DocumentRoot "c://htdocs"
-
- /htdocs">
- AllowOverride All --
- Require all granted -- this is required in Apache 2.4.4
-
-
-Check that you have the following modules enabled
-
- LoadModule cgi_module modules/mod_cgi.so
- LoadModule rewrite_module modules/mod_rewrite.so
-
-####Tip:
->To check the syntax of your httpd.conf file. From command line run the following
-
- $>httpd - t
-
-
->.htaccess CGI
- http://perishablepress.com/stupid-htaccess-tricks/
-
-####.htaccess
-
- Options +ExecCGI +Includes +FollowSymLinks -Indexes
- AddHandler cgi-script exe
-
-
- RewriteEngine on
-
- RewriteRule ^$ $service [L]
-
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !$service
- RewriteRule ^(.*)$ $service/$1
-
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
- Replace $service with the name of your executable service, for example app_service.exe
-
-
-####Deploying EWF FCGI
->To deploy FCGI you will need to download the mod_fcgi module.
->You can get it from here http://www.apachelounge.com/download/
-
-####FCGI overview
->FastCGI allows a single, long-running process to handle more than one user request while keeping close to the CGI programming model, retaining the simplicity while eliminating the overhead of creating a new process for each request. Unlike converting an application to a web server plug-in, FastCGI applications remain independent of the web server.
-
-* Build EWF application
-
- ec -config [app.ecf] -target [app_fcgi] -finalize -c_compile -project_path .
-
->Note: change app.ecf and target app_fcgi based on your own configuration.
-
-* Copy the generated exe file and the www content
-
-Copy the app.exe and the folder "www" into a folder served by apache2, for example under
-
- /htdocs.
-
- = path to your apache installation
-
- Edit httpd.conf under c://conf
-
- DocumentRoot "c://htdocs"
-
- /htdocs">
- AllowOverride All --
- Require all granted -- this is required in Apache 2.4.4
-
-
->Check that you have the following modules enabled
-
- LoadModule rewrite_module modules/mod_rewrite.so
- LoadModule fcgid_module modules/mod_fcgid.so
-
->NOTE: By default Apache does not come with fcgid module, so you will need to download it, and put the module under Apache2/modules
-
-#.htaccess FCGI
->http://perishablepress.com/stupid-htaccess-tricks/
-
-####.htaccess
-
- Options +ExecCGI +Includes +FollowSymLinks -Indexes
-
-
- AddHandler fcgid-script .ews
- FcgidWrapper $FULL_PATH/$service .ews
-
-
-
-
- RewriteEngine on
-
- RewriteBase /
- RewriteRule ^$ service.ews [L]
-
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !=/favicon.ico
- RewriteCond %{REQUEST_URI} !service.ews
- RewriteRule ^(.*)$ service.ews/$1
-
-
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
-
-
-Replace $service with the name of your executable $service, for example app_service.exe
-You will need to create an service.ews file, this file will be located at the same place where you copy your app service executable.
-
-
-
-
diff --git a/doc/workbook/deployment/readme.md b/doc/workbook/deployment/readme.md
new file mode 100644
index 0000000..91a9179
--- /dev/null
+++ b/doc/workbook/deployment/readme.md
@@ -0,0 +1,189 @@
+Nav: [Workbook](../workbook.md)
+
+EWF Deployment
+==============
+
+# Apache on Windows#
+
+1. Apache Install
+2. Deploying EWF CGI
+3. CGI overview
+ 1. Build EWF application
+ 2. Copy the generated exe file and the www content .htaccess CGI
+4. Deploying EWF FCGI
+5. FCGI overview
+ 1. Build EWF application
+ 2. Copy the generated exe file and the www content.htaccess CGI
+
+
+
+## Apache on Windows
+
+### Apache Install
+
+>Check the correct version (Win 32 or Win64)
+>Apache Version: Apache 2.4.4
+>Windows: http://www.apachelounge.com/download/
+
+note: on linux (debian), use
+> sudo apt-get install apache2
+
+#### Deploying EWF CGI
+
+#### CGI overview
+>A new process is started for each HTTP request. So if there are N requests to the same
+>CGI program, the code of the CGI program is loaded into memory N times.
+>When a CGI program finishes handling a request, the program terminates.
+
+* Build EWF application
+
+ ec -config [app.ecf] -target [app_cgi] -finalize -c_compile -project_path
+
+
+>Note: change app.ecf and target app_cgi based on your own configuration.
+
+* Copy the generated exe file and the www content
+
+Copy the app.exe and the folder _www_ into a folder served by apache2, for example under.
+
+
+ /htdocs.
+
+ = path to your apache installation
+
+ Edit httpd.conf under c://conf
+
+ DocumentRoot "c://htdocs"
+
+ /htdocs">
+ AllowOverride All --
+ Require all granted -- this is required in Apache 2.4.4
+
+
+Check that you have the following modules enabled
+
+ LoadModule cgi_module modules/mod_cgi.so
+ LoadModule rewrite_module modules/mod_rewrite.so
+
+#### Tip:
+>To check the syntax of your httpd.conf file. From command line run the following
+
+ $>httpd - t
+
+
+>.htaccess CGI
+ http://perishablepress.com/stupid-htaccess-tricks/
+
+#### .htaccess
+
+ Options +ExecCGI +Includes +FollowSymLinks -Indexes
+ AddHandler cgi-script exe
+
+
+ RewriteEngine on
+
+ RewriteRule ^$ $service [L]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_URI} !$service
+ RewriteRule ^(.*)$ $service/$1
+
+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
+ Replace $service with the name of your executable service, for example app_service.exe
+
+
+#### Deploying EWF FCGI
+>To deploy FCGI you will need to download the mod_fcgi module.
+>You can get it from here http://www.apachelounge.com/download/
+
+note: on linux (debian), use
+> sudo apt-get install libapache2-mod-fastcgi
+
+#### FCGI overview
+>FastCGI allows a single, long-running process to handle more than one user request while keeping close to the CGI programming model, retaining the simplicity while eliminating the overhead of creating a new process for each request. Unlike converting an application to a web server plug-in, FastCGI applications remain independent of the web server.
+
+* Build EWF application
+
+ ec -config [app.ecf] -target [app_fcgi] -finalize -c_compile -project_path .
+
+>Note: change app.ecf and target app_fcgi based on your own configuration.
+
+* Copy the generated exe file and the www content
+
+Copy the app.exe and the folder "www" into a folder served by apache2, for example under
+
+ /htdocs.
+
+ = path to your apache installation
+
+ Edit httpd.conf under c://conf
+
+ DocumentRoot "c://htdocs"
+
+ /htdocs">
+ AllowOverride All --
+ Require all granted -- this is required in Apache 2.4.4
+
+
+>Check that you have the following modules enabled
+
+ LoadModule rewrite_module modules/mod_rewrite.so
+ LoadModule fcgid_module modules/mod_fcgid.so
+
+>NOTE: By default Apache does not come with fcgid module, so you will need to download it, and put the module under Apache2/modules
+
+It is also possible to set various parameters in the apache site configuration file such as:
+```
+
+ # FcgidIdleTimeout 600
+ # FcgidBusyScanInterval 120
+ # FcgidProcessLifeTime 3600
+ # FcgidMaxProcesses 5
+ # FcgidMaxProcessesPerClass 100
+ # FcgidMinProcessesPerClass 100
+ # FcgidConnectTimeout 8
+ # FcgidIOTimeout 60
+ # FcgidBusyTimeout 1200
+
+```
+See https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html for more information.
+
+# .htaccess FCGI
+
+```
+http://perishablepress.com/stupid-htaccess-tricks/
+```
+
+#### .htaccess
+
+ Options +ExecCGI +Includes +FollowSymLinks -Indexes
+
+
+ AddHandler fcgid-script .ews
+ FcgidWrapper $FULL_PATH/$service .ews
+
+
+
+
+ RewriteEngine on
+
+ RewriteBase /
+ RewriteRule ^$ service.ews [L]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_URI} !=/favicon.ico
+ RewriteCond %{REQUEST_URI} !service.ews
+ RewriteRule ^(.*)$ service.ews/$1
+
+
+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
+
+
+Replace $service with the name of your executable $service, for example app_service.exe
+You will need to create an service.ews file, this file will be located at the same place where you copy your app service executable.
+
+Nav: [Workbook](../workbook.md)
diff --git a/doc/workbook/generating_response/generating_response.md b/doc/workbook/generating_response/generating_response.md
index 4d63cdf..977daf7 100644
--- a/doc/workbook/generating_response/generating_response.md
+++ b/doc/workbook/generating_response/generating_response.md
@@ -1,5 +1,5 @@
-Nav: [Workbook](../workbook.md) | [Handling Requests: Header Fields](/doc/workbook/handling_request/headers.md) | [Handling Cookies](/doc/workbook/handling_cookies/handling_cookies.md)
+Nav: [Workbook](../workbook.md) :: [Handling Requests: Header Fields](../handling_request/headers.md) :: [Handling Cookies](../handling_cookies/handling_cookies.md)
## EWF Generating Response
@@ -14,7 +14,8 @@ Nav: [Workbook](../workbook.md) | [Handling Requests: Header Fields](/doc/workbo
- [Response Header Fields](#header_fields)
-
+
+
## Format of the HTTP response
As we saw in the previous documents, a request from a user-agent (browser or other client) consists of an HTTP command (usually GET or POST), zero or more request headers (one or more in HTTP 1.1, since Host is required), a blank line, and only in the case of POST/PUT requests, payload data. A typical request looks like the following.
@@ -49,7 +50,8 @@ looks like this:
The status line consists of the HTTP version (HTTP/1.1 in the preceding example), a status code (an integer 200 in the example), and a very short message corresponding to the status code (OK in the example). In most cases, the headers are optional except for Content-Type, which specifies the MIME type of the document that follows. Although most responses contain a document, some don’t. For example, responses to HEAD requests should never include a document, and various status codes essentially indicate failure or redirection (and thus either don’t include a document or include only a short error-message document).
-
+
+
## How to set the status code
If you need to set an arbitrary status code, you can use the ```WSF_RESPONSE.put_header``` feature or the ```WSF_RESPONSE.set_status_code``` feature. An status code of 200 is a default value. See below examples using the mentioned features.
@@ -94,7 +96,8 @@ Example
```
Both features takes an INTEGER (the status code) as an formal argument, you can use 200, 300, 500 etc directly, but instead of using explicit numbers, it's recommended to use the constants defined in the class [HTTP_STATUS_CODE](). The name of each constant is based from the standard [HTTP 1.1](https://httpwg.github.io/).
-
+
+
## How to redirect to a particular location.
To redirect the response to a new location, we need to send a 302 status code, to do that we use ```{HTTP_STATUS_CODE}.found```
@@ -145,7 +148,8 @@ The ```WSF_RESPONSE.redirect_now``` feature use the status code ```{HTTP_STATUS_
Using a similar approach we can build features to answer a bad request (400), internal server error (500), etc. We will build a simple example showing the most common HTTP status codes.
-
+
+
## [HTTP 1.1 Status Codes](https://httpwg.github.io/specs/rfc7231.html#status.codes)
The status-code element is a three-digit integer code giving the result of the attempt to understand and satisfy the request. The first digit of the status-code defines the class of response.
@@ -159,7 +163,8 @@ General categories:
Note: use ```res.set_status_code({HTTP_STATUS_CODE}.bad_request)``` rather than ```res.set_status_code(400)```.
-
+
+
### Example Staus Codes
Basic Service that builds a simple web page to show the most common status codes
```eiffel
@@ -298,7 +303,8 @@ end
-
+
+
### Example Generic Search Engine
The following example shows a basic EWF service that builds a generic front end for the most used search engines. This example shows how
redirection works, and we will use a tools to play with the API to show differents responses.
@@ -585,7 +591,8 @@ Connection: close