Login
or
register
Xavante
Xavante
Anonymous users must enter
captcha
below.
Don't put anything here
Page Content
This instructions can be used both in UNIX as in Windows systems (assuming you have [[Installation|installed]] Xavante using LuaForWindows and LuaRocks). #Starting Xavante using WSAPI Xavante is an embeddable web server, which means that it is distributed as a Lua module that should be called from an application. This allows the use of more than one Xavante instance running at the same time (in different ports), each one associated with one application. The `wsapi-xavante` rock installation creates an executable named `wsapi`that can be used to start Xavante. This executable should be called from the directory that will be considered your site root directory. From this directory you can both execute the `wsapi` command to start a Xavante server with the default configuration (which is the handling of WSAPI applications, using the `.lua` or `.ws` extensions), as passing parameters to the `wsapi` command in order to use alternative configurations. If you want to know more about the `wsapi` command, use <pre> wsapi --help </pre> For example, to run Xavante with Orbit Pages support (assuming that the Orbit rock is installed), you should use <pre> wsapi --op </pre> **important**: Note that the use of the `--op` parameter is related only to the support of Orbit Pages (which use the `.op` extension). Orbit applications are also WSAPI applications, so they use the same extensions as WSAPI. # Running the WSAPI applications examples with Xavante The `wsapi-xavante` rock installation offers some WSAPI examples. These examples can be found at the `rocks/wsapi/X.Y.Z-V/samples` directory in your system (where `X.Y.Z-V` refers to the installed WSAPI version). Before running the example, check if there is no other Xavante instance running and go to the WSAPI examples directory (replacing `X.Y.Z-V` by the correct version): <pre> cd rocks/wsapi/X.Y.Z-V/samples </pre> Execute now the `wsapi` command and check if the Xavante startup message is printed in the terminal. If everything is fine, open the first example URL in your browser (`hello.lua`). This example is quite basic but it shows how a WSAPI application receives request parameters, generates the response content and finally returns the HTTP status, the HTTP headers and the content itself. <pre> http://localhost:8080/hello.lua </pre> You should see the following output: <pre> Hello Wsapi! PATH_INFO: / SCRIPT_NAME: /hello.lua </pre> **Important**: Note that the other examples in the `samples` directory refer to command line uses of WSAPI and should not be run through the browser. #Running Orbit examples with Xavante To use [Orbit](http://keplerproject.github.com/orbit) with Xavante you will need to first install the `orbit` rock: <pre> luarocks install orbit </pre> Before executing the examples, check if there are no other Xavante instances running and go to the Orbit examples directory (replacing `X.Y.Z-V` by the correct version): <pre> cd rocks/orbit/X.Y.Z-V/samples </pre> Execute now the `wsapi` command and check if the Xavante startup message is printed in the terminal. If everything is fine, proceed to the [[Examples]] page.
Don't put anything here
Don't put anything here
Advanced Fields
Page Name (for URL)
Page Title
Breadcrumb Text
Category
Credits
Dev Team
Examples
General FAQ
Installation
Mailing List
Overview
Overview
Site Map
Vision
Web Servers
Why Lua?
A summary of your changes
Don't put anything here
Don't put anything here
Don't put anything here
save
preview
cancel
Overview
Overview
Why Lua?
Vision
General FAQ
Credits
Site Map
Using WSAPI
Installation
Web Servers
Examples
Community
Overview
Dev Team
Mailing List