webmcp

annotate doc/autodoc-header.htmlpart @ 507:ac5f7a40b8c4

Extended documentation (mostly on "Configuration, pre-fork and post-fork initializers")
author jbe
date Sun Aug 20 23:12:16 2017 +0200 (2017-08-20)
parents 0221836a9db5
children 6c819040ef6f
rev   line source
jbe/bsw@0 1 <html>
jbe/bsw@0 2 <head>
jbe@381 3 <script type="text/javascript">
jbe@390 4 var expandedSections = {};
jbe@390 5 function toggleSection(ident) {
jbe@390 6 var element = document.getElementById('autodoc_details_' + ident);
jbe@390 7 if (element) {
jbe@390 8 if (expandedSections[ident]) {
jbe@390 9 element.style.display = 'none';
jbe@390 10 delete expandedSections[ident];
jbe@390 11 } else {
jbe@390 12 element.style.display = '';
jbe@390 13 expandedSections[ident] = true;
jbe@390 14 }
jbe@381 15 }
jbe@390 16 }
jbe@391 17 var inProgress = false;
jbe@390 18 window.onload = window.onhashchange = function() {
jbe@391 19 if (inProgress) return;
jbe@390 20 for (var ident in expandedSections) toggleSection(ident);
jbe@390 21 var hash = window.location.hash;
jbe@390 22 if (hash) {
jbe@390 23 toggleSection(hash.replace(/^#/, ''));
jbe@391 24 inProgress = true;
jbe@391 25 window.location.hash = hash; // required after collapsing/expanding
jbe@391 26 inProgress = false;
jbe@390 27 }
jbe@389 28 };
jbe@381 29 </script>
jbe/bsw@0 30 <style>
jbe/bsw@0 31 body {
jbe/bsw@0 32 font-family: "Liberation Sans", sans-serif;
jbe/bsw@0 33 font-size: 11pt;
jbe/bsw@0 34 padding-bottom: 5ex;
jbe/bsw@0 35 }
jbe/bsw@0 36 .warning {
jbe/bsw@0 37 color: #ff0000;
jbe/bsw@0 38 }
jbe/bsw@0 39 h1, h2 {
jbe/bsw@0 40 font-family: "Liberation Serif", Georgia, serif;
jbe/bsw@0 41 }
jbe/bsw@0 42 h2 {
jbe/bsw@0 43 margin-bottom: 0.3ex;
jbe/bsw@0 44 }
jbe/bsw@0 45 p {
jbe@507 46 margin-bottom: 1ex;
jbe/bsw@0 47 line-height: 130%;
jbe/bsw@0 48 }
jbe/bsw@0 49 tt, pre {
jbe/bsw@0 50 font-size: 10pt;
jbe/bsw@0 51 }
jbe/bsw@0 52 tt {
jbe/bsw@0 53 font-weight: bold;
jbe/bsw@0 54 white-space: nowrap;
jbe/bsw@0 55 }
jbe/bsw@0 56 .autodoc_entry {
jbe/bsw@0 57 margin-top: 1ex;
jbe/bsw@0 58 margin-bottom: 1ex;
jbe/bsw@0 59 }
jbe/bsw@0 60 .autodoc_comment_tail {
jbe/bsw@0 61 font-style: italic;
jbe/bsw@0 62 }
jbe/bsw@0 63 .autodoc_entry .short_synopsis {
jbe/bsw@0 64 cursor: pointer;
jbe/bsw@0 65 }
jbe@507 66 .AUTODOC_details {
jbe/bsw@0 67 padding-left: 1em;
jbe/bsw@0 68 padding-right: 1em;
jbe/bsw@0 69 border: 1px solid #777;
jbe/bsw@0 70 }
jbe/bsw@0 71 .autodoc_synopsis {
jbe/bsw@0 72 font-weight: bold;
jbe/bsw@0 73 }
jbe/bsw@0 74 .autodoc_synopsis .autodoc_comment_tail {
jbe/bsw@0 75 font-weight: normal;
jbe/bsw@0 76 color: #008000;
jbe/bsw@0 77 }
jbe/bsw@0 78 .autodoc_entry .autodoc_comment {
jbe/bsw@0 79 color: #400080;
jbe/bsw@0 80 }
jbe/bsw@0 81 .autodoc_source {
jbe/bsw@0 82 color: #505050;
jbe/bsw@0 83 }
jbe/bsw@0 84 </style>
jbe@446 85 <title>WebMCP 2.1.0 Documentation</title>
jbe/bsw@0 86 </head>
jbe/bsw@0 87 <body>
jbe@446 88 <h1>WebMCP 2.1.0 Documentation</h1>
jbe/bsw@0 89 <p>
jbe@278 90 WebMCP is a web development framework based on the Lua programming language (read more about Lua <a href="http://www.lua.org/about.html">here</a>).
jbe/bsw@0 91 </p>
jbe/bsw@0 92 <h2>Requirements</h2>
jbe/bsw@0 93 <p>
jbe@387 94 WebMCP has been developed on Linux and FreeBSD. Using it with Mac&nbsp;OS&nbsp;X is untested as of yet; Microsoft Windows is not supported. Beside the operating system, the only mandatory dependencies for WebMCP are the <a href="http://www.lua.org/">programming language Lua</a> version 5.2 or 5.3, the <a href="http://www.public-software-group.org/moonbridge">Moonbridge Network Server for Lua Applications</a> version 1.0.1 or higher, <a href="http://www.postgresql.org/">PostgreSQL</a> version 8.2 or higher, and a C compiler.
jbe/bsw@0 95 </p>
jbe/bsw@0 96 <h2>Installation</h2>
jbe/bsw@0 97 <p>
jbe@507 98 After downloading the tar.gz package, unpack it, enter the unpacked directory and type <tt>make</tt>. If you use Mac OS X or if you experience problems during compilation, you need to edit the <tt>Makefile.options</tt> file prior to compilation. The framework itself will be available in the <tt>framework/</tt> directory, while a demo application is available in the <tt>demo-app/</tt> directory. The <tt>framework.precompiled/</tt> and <tt>demo-app.precompiled/</tt> directories will contain a version with all Lua files being byte-code pre-compiled, which can be used instead. You may copy these directories (with <tt>cp -L</tt> to follow links) to any other place you like. Don't forget to setup a database, and make the <tt>tmp/</tt> directory of the application writable for user who executes WebMCP. Good luck and have fun!
jbe@507 99 </p>
jbe@507 100 <h2>Configuration, initializers, and request handling</h2>
jbe@507 101 <p>
jbe@507 102 WebMCP uses the <a href="http://www.public-software-group.org/moonbridge">Moonbridge Network Server</a> to handle HTTP requests. The Moonbridge Network Server listens to a TCP port and passes control to WebMCP by calling <a href="#request.handler"><tt>request.handler(...)</tt></a> for each request. However, before each request is processed, WebMCP will initialize the environment. This initialization includes tasks such as
jbe@507 103 </p>
jbe@507 104 <ul>
jbe@507 105 <li>loading libraries,</li>
jbe@507 106 <li>configuring the database connection or the application,</li>
jbe@507 107 <li>connecting to the database,</li>
jbe@507 108 <li>etc.</li>
jbe@507 109 </ul>
jbe@507 110 <p>
jbe@507 111 For each request, it is also possible to execute filters. Filters can be used to
jbe@278 112 </p>
jbe@507 113 <ul>
jbe@507 114 <li>
jbe@507 115 restrict access for certain requests, e.g. by performing redirects or raising errors
jbe@507 116 </li>
jbe@507 117 <li>
jbe@507 118 perform tasks that are common for different requests, e.g.
jbe@507 119 <ul>
jbe@507 120 <li>execution certain database requests,</li>
jbe@507 121 <li>prepare a menu on the website,</li>
jbe@507 122 <li>&hellip;</li>
jbe@507 123 </ul>
jbe@507 124 </li>
jbe@507 125 </ul>
jbe@278 126 <p>
jbe@507 127 Filters and initializers are created by adding files in the application's directory structure. The filename determins the execution order of otherwise equally ranked initializers and/or filters. It is a common idiom to start the filename of a filter or initializer with a two digit number to be easily able to change the execution order when desired. Filters and initializers are executed both before and after a request. Each file must contain a command <a href="#execute.inner"><tt>execute.inner()</tt></a>. The part before that command is executed before the request, and the part after that command is executed after the request.
jbe@507 128 </p>
jbe@507 129 <p>
jbe@507 130 The Moonbridge server creates forks (i.e. clones) of the application server process (i.e. the whole Lua engine including all libraries and variables) in order to handle concurrent requests. Certain initializations may be performed before forking, other initializations must be performed after forking. For this purpose, WebMCP allows an application to provide so-called "pre-fork" and "post-fork" initializers. The application's configuration files as well as its pre-fork initializers are executed before forking. The application's post-fork initializers are executed after forking. In particular, any libraries that open file or network handles during initialization must not be loaded before the server process is forked. Opening database connections must be performed after forking as well. WebMCP follows the following execution order (directory structure is explained further down):
jbe@278 131 </p>
jbe@278 132 <ol>
jbe@278 133 <li>
jbe@278 134 Loading all WebMCP libraries except the "multirand" library (multirand opens /dev/urandom and thus must not be loaded prior to forking)
jbe@278 135 </li>
jbe@278 136 <li>
jbe@278 137 Executing the selected configuration file: <tt>config/</tt><i>configuration_name</i><tt>.lua</tt>
jbe@278 138 </li>
jbe@278 139 <li>
jbe@278 140 Executing all pre-fork initializers (both those in the <tt>app/_prefork/</tt> and those in the <tt>app/</tt><i>application_name</i><tt>/_prefork/</tt> directory) until call of <tt>execute.inner()</tt> within each initializer
jbe@278 141 </li>
jbe@278 142 <li>
jbe@278 143 The Moonbridge Network Server forks the process (i.e. cloning the whole Lua machine)<br />
jbe@278 144 <span style="color: red">Note: no file handles or network connections must be opened prior to this point!</span>
jbe@278 145 </li>
jbe@278 146 <li>
jbe@281 147 Loading WebMCP's "multirand" library
jbe@281 148 </li>
jbe@281 149 <li>
jbe@278 150 Executing all post-fork initializers (both those in the <tt>app/_postfork/</tt> and those in the <tt>app/</tt><i>application_name</i><tt>/_postfork/</tt> directory) until call of <tt>execute.inner()</tt> within each initializer
jbe@278 151 </li>
jbe@278 152 <li>
jbe@278 153 For each request:
jbe@278 154 <ul>
jbe@278 155 <li>
jbe@278 156 Execution of all applicable filters until call of <tt>execute.inner()</tt> within each filter
jbe@278 157 </li>
jbe@278 158 <li>
jbe@278 159 Handling of the request by calling the appropriate view or action
jbe@278 160 </li>
jbe@278 161 <li>
jbe@278 162 Resuming execution of all filters in reverse order from that position where <tt>execute.inner()</tt> had been called
jbe@278 163 </li>
jbe@278 164 </ul>
jbe@278 165 </li>
jbe@278 166 <li>
jbe@278 167 Resuming execution of all post-fork initializers in reverse order from that position where <tt>execute.inner()</tt> had been called
jbe@278 168 </li>
jbe@278 169 <li>
jbe@278 170 Resuming execution of all pre-fork initializers in reverse order from that position where <tt>execute.inner()</tt> had been called
jbe@278 171 </li>
jbe@278 172 </ol>
jbe/bsw@0 173 </p>
jbe@439 174 <p>
jbe@439 175 As a minimum configuration, the used configuration file or pre-fork initializer should at least contain a <tt>listen{...}</tt> call, e.g.:
jbe@439 176 </p>
jbe@439 177 <pre>
jbe@439 178 listen{
jbe@439 179 { proto = "tcp", host = "::", port = 8080 },
jbe@439 180 { proto = "tcp", host = "0.0.0.0", port = 8080 }
jbe@439 181 }
jbe@507 182 execute.inner() -- only use this line if done in pre-fork initializer</pre>
jbe/bsw@0 183 <h2>Using the atom library</h2>
jbe/bsw@0 184 <p>
jbe/bsw@0 185 Lua itself has only very few built-in data types. The atom library gives support for extra data types. Currently the following extra data types are provided:
jbe/bsw@0 186 </p>
jbe/bsw@0 187 <ul>
jbe/bsw@0 188 <li>atom.fraction</li>
jbe/bsw@0 189 <li>atom.date</li>
jbe/bsw@0 190 <li>atom.time</li>
jbe/bsw@0 191 <li>atom.timestamp (date and time combined in one data type)</li>
jbe/bsw@0 192 </ul>
jbe/bsw@0 193 <p>
jbe/bsw@0 194 In addition the following pseudo-types are existent, corresponding to Lua's base types:
jbe/bsw@0 195 </p>
jbe/bsw@0 196 <ul>
jbe/bsw@0 197 <li>atom.boolean</li>
jbe/bsw@0 198 <li>atom.string</li>
jbe/bsw@0 199 <li>atom.integer</li>
jbe/bsw@0 200 <li>atom.number</li>
jbe/bsw@0 201 </ul>
jbe/bsw@0 202 <p>
jbe/bsw@0 203 Both atom.integer and atom.number refer to Lua's base type &ldquo;number&rdquo;.
jbe/bsw@0 204 </p>
jbe/bsw@0 205 <p>
jbe/bsw@0 206 New values of atom data types are created by either calling <tt>atom.<i>type</i>:load(string_representation)</tt> or by calling <tt>atom.<i>type</i>{...}</tt>, e.g. <tt>atom.date{year=1970, month=1, day=1}</tt>. You can dump any atom value as a string by calling <tt>atom.dump(value)</tt> and later reload it with <tt>atom.<i>type</i>:load(string)</tt>.
jbe/bsw@0 207 </p>
jbe/bsw@0 208 <h2>Using the Object-Relational Mapper &ldquo;mondelefant&rdquo;</h2>
jbe/bsw@0 209 <p>
jbe@278 210 The library &ldquo;mondelefant&rdquo; shipping with WebMCP can be used to access PostgreSQL databases. It also serves as an Object-Relational Mapper (ORM). The database connection is usually configured in the config file (e.g. in <tt>config/devel.lua</tt>):
jbe@278 211 </p>
jbe@278 212 <pre>
jbe@439 213 config.db = { engine="postgresql", dbname="webmcp_demo" }</pre>
jbe@278 214 <p>
jbe@278 215 In addition to configuring the database, it must be opened within a post-fork initializer (e.g. in <tt>app/_postfork/01_database.lua</tt>):
jbe/bsw@0 216 </p>
jbe/bsw@0 217 <pre>
jbe@278 218 _G.db = assert(mondelefant.connect(config.db))
jbe@439 219 function mondelefant.class_prototype:get_db_conn() return db end
jbe@439 220 execute.inner()</pre>
jbe/bsw@0 221 <p>
jbe@295 222 The parameters for <tt>mondelefant.connect</tt> are directly passed to PostgreSQL's client library libpq. See <a href="http://www.postgresql.org/docs/9.4/static/libpq-connect.html">PostgreSQL's documentation on PQconnect</a> for information about supported parameters.
jbe/bsw@0 223 </p>
jbe/bsw@0 224 <p>
jbe/bsw@0 225 To define a model to be used within a WebMCP application, create a file named with the name of the model and <tt>.lua</tt> as extension in the <tt>model/</tt> directory of your application. The most basic definition of a model (named &ldquo;movie&rdquo; in this example) is:
jbe/bsw@0 226 </p>
jbe/bsw@0 227 <pre>
jbe/bsw@0 228 Movie = mondelefant.new_class()
jbe/bsw@0 229 Movie.table = 'movie'</pre>
jbe/bsw@0 230 <p>
jbe/bsw@0 231 Note: Model classes are always written CamelCase, while the name of the file in <tt>model/</tt> is written lower_case.
jbe/bsw@0 232 </p>
jbe/bsw@0 233 <p>
jbe/bsw@0 234 To select objects from the database, the mondelefant library provides a selector framework:
jbe/bsw@0 235 </p>
jbe/bsw@0 236 <pre>
jbe/bsw@0 237 local s = Movie:new_selector()
jbe/bsw@0 238 s:add_where{ 'id = ?', param.get_id() }
jbe/bsw@0 239 s:single_object_mode() -- return single object instead of list
jbe/bsw@0 240 local movie = s:exec()</pre>
jbe/bsw@0 241 <p>
jbe/bsw@0 242 A short form of the above query would be:
jbe/bsw@0 243 </p>
jbe/bsw@0 244 <pre>
jbe/bsw@0 245 local movie = Movie:new_selector():add_where{ 'id = ?', param.get_id() }:single_object_mode():exec()</pre>
jbe/bsw@0 246 <p>
jbe/bsw@0 247 For more examples about how to use the model system, please take a look at the demo application.
jbe/bsw@0 248 </p>
jbe/bsw@0 249 <h2>The Model-View-Action (MVA) concept</h2>
jbe/bsw@0 250 <p>
jbe/bsw@0 251 As opposed to other web application frameworks, WebMCP does not use a Model-View-Controller (MVC) concept, but a Model-View-Action (MVA) concept.
jbe/bsw@0 252 </p>
jbe/bsw@0 253 <h3>Models</h3>
jbe/bsw@0 254 <p>
jbe/bsw@0 255 The models in MVA are like the models in MVC; they are used to access data stored in a relational database (PostgreSQL) in an object oriented way. They can also be used to provide methods for working with objects representing the database entries.
jbe/bsw@0 256 </p>
jbe/bsw@0 257 <h3>Views</h3>
jbe/bsw@0 258 <p>
jbe/bsw@0 259 The views in the MVA concept are different from the views in the MVC concept. As WebMCP has no controllers, the views are responsible for processing the GET/POST parameters from the webbrowser, fetching the data to be displayed, and creating the output by directly writing HTML to slots in a layout or by calling helper functions for the user interface.
jbe/bsw@0 260 </p>
jbe/bsw@0 261 <h3>Actions</h3>
jbe/bsw@0 262 <p>
jbe/bsw@0 263 Actions are similar to views, but supposed to change data in the database, hence only callable by HTTP POST requests. They are also responsible for processing the POST parameters from the webbrowser. They can modify the database, but instead of rendering a page to be displayed, they just return a status code. Depending on the status code there will be an internal forward or an HTTP 303 redirect to a view. When calling an action via a POST request, additional POST parameters, which are usually added by hidden form fields, determine the view to be displayed for each status code returned by the action.
jbe/bsw@0 264 </p>
jbe/bsw@0 265 <h2>Directory structure of a WebMCP application</h2>
jbe/bsw@0 266 <ul>
jbe/bsw@0 267 <li>
jbe/bsw@0 268 Base Directory
jbe/bsw@0 269 <ul>
jbe/bsw@0 270 <li>
jbe/bsw@0 271 <tt>app/</tt>
jbe/bsw@0 272 <ul>
jbe/bsw@0 273 <li>
jbe@278 274 <tt>_prefork/</tt>
jbe@278 275 <ul>
jbe@278 276 <li>
jbe@278 277 <tt>10_first_prefork_initializer.lua</tt>
jbe@278 278 </li>
jbe@278 279 <li>
jbe@278 280 <tt>30_third_prefork_initializer.lua</tt>
jbe@278 281 </li>
jbe@278 282 </ul>
jbe@278 283 </li>
jbe@278 284 <li>
jbe@278 285 <tt>_postfork/</tt>
jbe@278 286 <ul>
jbe@278 287 <li>
jbe@278 288 <tt>01_first_postfork_initializer.lua</tt>
jbe@278 289 </li>
jbe@278 290 <li>
jbe@278 291 <tt>03_third_postfork_initializer.lua</tt>
jbe@278 292 </li>
jbe@278 293 </ul>
jbe@278 294 </li>
jbe@278 295 <li>
jbe/bsw@0 296 <tt>main/</tt>
jbe/bsw@0 297 <ul>
jbe/bsw@0 298 <li>
jbe@278 299 <tt>_prefork/</tt>
jbe@278 300 <ul>
jbe@278 301 <li>
jbe@278 302 <tt>20_second_prefork_initializer.lua</tt>
jbe@278 303 </li>
jbe@278 304 </ul>
jbe@278 305 </li>
jbe@278 306 <li>
jbe@278 307 <tt>_postfork/</tt>
jbe@278 308 <ul>
jbe@278 309 <li>
jbe@278 310 <tt>02_second_postfork_initializer.lua</tt>
jbe@278 311 </li>
jbe@278 312 </ul>
jbe@278 313 </li>
jbe@278 314 <li>
jbe/bsw@0 315 <tt>_filter/</tt>
jbe/bsw@0 316 <ul>
jbe/bsw@0 317 <li>
jbe/bsw@0 318 <tt>10_first_filter.lua</tt>
jbe@278 319 </li>
jbe/bsw@0 320 <li>
jbe/bsw@0 321 <tt>30_third_filter.lua</tt>
jbe/bsw@0 322 </li>
jbe/bsw@0 323 <li>&hellip;</li>
jbe/bsw@0 324 </ul>
jbe/bsw@0 325 </li>
jbe/bsw@0 326 <li>
jbe/bsw@0 327 <tt>_filter_action/</tt>
jbe/bsw@0 328 <ul>
jbe/bsw@0 329 <li>
jbe/bsw@0 330 <tt>20_second_filter.lua</tt>
jbe/bsw@0 331 </li>
jbe/bsw@0 332 <li>&hellip;</li>
jbe/bsw@0 333 </ul>
jbe/bsw@0 334 </li>
jbe/bsw@0 335 <li>
jbe/bsw@0 336 <tt>_filter_view/</tt>
jbe/bsw@0 337 <ul>
jbe/bsw@0 338 <li>&hellip;</li>
jbe/bsw@0 339 </ul>
jbe/bsw@0 340 </li>
jbe/bsw@0 341 <li>
jbe/bsw@0 342 <tt>_layout/</tt>
jbe/bsw@0 343 <ul>
jbe/bsw@0 344 <li>&hellip;</li>
jbe/bsw@0 345 </ul>
jbe/bsw@0 346 </li>
jbe/bsw@0 347 <li>
jbe/bsw@0 348 <tt>index/</tt>
jbe/bsw@0 349 <ul>
jbe/bsw@0 350 <li>
jbe/bsw@0 351 <tt>_action/</tt>
jbe/bsw@0 352 <ul>
jbe/bsw@0 353 <li>
jbe/bsw@0 354 <i>action_name</i><tt>.lua</tt>
jbe/bsw@0 355 </li>
jbe/bsw@0 356 <li>
jbe/bsw@0 357 <i>another_action_name</i><tt>.lua</tt>
jbe/bsw@0 358 </li>
jbe/bsw@0 359 <li>&hellip;</li>
jbe/bsw@0 360 </ul>
jbe/bsw@0 361 </li>
jbe/bsw@0 362 <li>
jbe/bsw@0 363 <tt>index.lua</tt>
jbe/bsw@0 364 </li>
jbe/bsw@0 365 <li>
jbe/bsw@0 366 <i>other_view_name</i><tt>.lua</tt>
jbe/bsw@0 367 </li>
jbe/bsw@0 368 <li>&hellip;</li>
jbe/bsw@0 369 </ul>
jbe/bsw@0 370 </li>
jbe/bsw@0 371 <li>
jbe/bsw@0 372 <i>other_module_name</i><tt>/</tt>
jbe/bsw@0 373 <ul>
jbe/bsw@0 374 <li>&hellip;</li>
jbe/bsw@0 375 </ul>
jbe/bsw@0 376 </li>
jbe/bsw@0 377 </ul>
jbe/bsw@0 378 </li>
jbe/bsw@0 379 <li>
jbe/bsw@0 380 <i>other_application_name</i><tt>/</tt>
jbe/bsw@0 381 <ul>
jbe/bsw@0 382 <li>&hellip;</li>
jbe/bsw@0 383 </ul>
jbe/bsw@0 384 </li>
jbe/bsw@0 385 </ul>
jbe/bsw@0 386 </li>
jbe/bsw@0 387 <li>
jbe/bsw@0 388 <tt>config/</tt>
jbe/bsw@0 389 <ul>
jbe/bsw@0 390 <li>
jbe/bsw@0 391 <tt>development.lua</tt>
jbe/bsw@0 392 </li>
jbe/bsw@0 393 <li>
jbe/bsw@0 394 <tt>production.lua</tt>
jbe/bsw@0 395 <li>
jbe/bsw@0 396 <li>
jbe/bsw@0 397 <i>other_config_name</i><tt>.lua</tt>
jbe/bsw@0 398 </li>
jbe/bsw@0 399 <li>&hellip;</li>
jbe/bsw@0 400 </ul>
jbe/bsw@0 401 </li>
jbe/bsw@0 402 <li>
jbe/bsw@0 403 <tt>db/</tt>
jbe/bsw@0 404 <ul>
jbe/bsw@0 405 <li>
jbe/bsw@0 406 <tt>schema.sql</tt>
jbe/bsw@0 407 </li>
jbe/bsw@0 408 </ul>
jbe/bsw@0 409 </li>
jbe/bsw@0 410 <li>
jbe/bsw@0 411 <tt>locale/</tt>
jbe/bsw@0 412 <ul>
jbe/bsw@0 413 <li>
jbe/bsw@0 414 <tt>translations.de.lua</tt>
jbe/bsw@0 415 </li>
jbe/bsw@0 416 <li>
jbe/bsw@0 417 <tt>translations.en.lua</tt>
jbe/bsw@0 418 </li>
jbe/bsw@0 419 <li>
jbe/bsw@0 420 <tt>translations.</tt><i>languagecode</i><tt>.lua</tt>
jbe/bsw@0 421 </li>
jbe/bsw@0 422 <li>&hellip;</li>
jbe/bsw@0 423 </ul>
jbe/bsw@0 424 </li>
jbe/bsw@0 425 <li>
jbe/bsw@0 426 <tt>model/</tt>
jbe/bsw@0 427 <ul>
jbe/bsw@0 428 <li>
jbe/bsw@0 429 <i>model_name</i><tt>.lua</tt>
jbe/bsw@0 430 </li>
jbe/bsw@0 431 <li>
jbe/bsw@0 432 <i>another_model_name</i><tt>.lua</tt>
jbe/bsw@0 433 </li>
jbe/bsw@0 434 <li>&hellip;</li>
jbe/bsw@0 435 </ul>
jbe/bsw@0 436 </li>
jbe/bsw@0 437 <li>
jbe/bsw@0 438 <tt>static/</tt>
jbe/bsw@0 439 <ul>
jbe/bsw@0 440 <li>&hellip; (images, javascript, ...)</li>
jbe/bsw@0 441 </ul>
jbe/bsw@0 442 </li>
jbe/bsw@0 443 <li>
jbe/bsw@0 444 <tt>tmp/</tt> (writable by the web process)
jbe/bsw@0 445 </li>
jbe/bsw@0 446 </ul>
jbe/bsw@0 447 </li>
jbe/bsw@0 448 </ul>
jbe@278 449 <h2>Starting your application</h2>
jbe@278 450 <p>
jbe@278 451 Ensure that the <tt>moonbridge</tt> binary is within your system's search path and that the <tt>moonbridge_http.lua</tt> file is included in the LUA_PATH or linked into the framework's <tt>lib/</tt> directory (alternatively the MOONBR_LUA_PATH option might be set accordingly at compile-time of the Moonbridge Network Server). To start an application, call the <tt>mcp.lua</tt> executable (found in <tt>framework/bin/mcp.lua</tt>) with the following arguments:
jbe@278 452 </p>
jbe@278 453 <ol>
jbe@278 454 <li>
jbe@278 455 Path of the WebMCP framework directory, e.g. <tt>./framework</tt>
jbe@278 456 </li>
jbe@278 457 <li>
jbe@278 458 Path of your application's directory, e.g. <tt>./demo-app</tt>
jbe@278 459 </li>
jbe@278 460 <li>
jbe@278 461 Name of your applicaiton (usually <tt>main</tt>)
jbe@278 462 </li>
jbe@278 463 <li>
jbe@278 464 Name of configuration (e.g. <tt>devel</tt> to use config/devel.lua)
jbe@278 465 </li>
jbe@278 466 </ol>
jbe/bsw@0 467 <h2>Automatically generated reference for the WebMCP environment</h2>
jbe/bsw@0 468 <ul>

Impressum / About Us