92 lines
3.8 KiB
HTML
92 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Eiffel Web Framework</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="css/main.css" rel="stylesheet">
|
|
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
|
|
<link href="css/lang-eiffel.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<div class="container-narrow">
|
|
<div class="masthead">
|
|
<ul class="nav nav-pills pull-right">
|
|
<li><a href="index.html">Home</a></li>
|
|
<li class="active"><a href="getting-started.html">Getting Started</a></li>
|
|
<li><a href="community.html">Community</a></li>
|
|
</ul>
|
|
<h3 class="muted">Eiffel Web Framework</h3>
|
|
</div>
|
|
<hr>
|
|
<div class="row-fluid">
|
|
<div class="span12">
|
|
<div class="page-header">
|
|
<h1>Getting Started</h1>
|
|
</div>
|
|
<p>This page will help you to get started with EWF.
|
|
We will first see how to install EWF and then how to compile and run the venerable <i>Hello World</i> example.</p>
|
|
<h2>Installation</h2>
|
|
<h3>EiffelStudio 7.2</h3>
|
|
<p>EWF is already included in EiffelStudio 7.2: you don't have to do anything in this case!
|
|
This is the recommanded solution if you are a new developer or are new to Eiffel.</p>
|
|
<h3>Other EiffelStudio versions</h3>
|
|
<p>If you have another version of EiffelStudio than 7.2, you have to</p>
|
|
<ol>
|
|
<li><a href="http://github.com/EiffelWebFramework/EWF/zipball/release-0.2">dowload EWF</a></li>
|
|
<li>create a directory where you will put your custum Eiffel libraries</li>
|
|
<li>extract EWF in the newly created directory</li>
|
|
<li>define the environment variable EIFFEL_LIBRARY to point to the newly created directory</li>
|
|
</ol>
|
|
<h3>Source code</h3>
|
|
<p>The source code is available on Github.
|
|
You can get it by running the command:</p>
|
|
<pre><code>git clone --recursive git://github.com/EiffelWebFramework/EWF.git</code></pre>
|
|
<h2>Hello World</h2>
|
|
<p>The hello world example is located in the directory <i>$ISE_EIFFEL/contrib/examples/web/ewf/simple</i>.
|
|
Just double click on the <i>simple.ecf</i> file and select the <i>simple</i> target or if you prefer the command line, run the command:</p>
|
|
<pre><code>estudio -config simple.ecf -target simple</code></pre>
|
|
<p>Once the project is compiled, we will adapt the root class to point to port number 9090.</p>
|
|
<div class="alert alert-info">
|
|
<strong>Note</strong>: By default, the application listens on port 80, which is often already used by standard webservers (Apache, nginx, ...).
|
|
Moreover, on Linux, ports below 1024 can only be opened by root.
|
|
</div>
|
|
<p>To do this, we will redefine the feature <i>initialize</i> as follows:</p>
|
|
<pre class="prettyprint lang-eiffel">
|
|
class
|
|
APPLICATION
|
|
|
|
inherit
|
|
WSF_DEFAULT_SERVICE
|
|
redefine
|
|
initialize
|
|
end
|
|
|
|
create
|
|
make_and_launch
|
|
|
|
feature {NONE} -- Initialization
|
|
|
|
initialize
|
|
-- Initialize current service
|
|
do
|
|
set_service_option ("port", 9090)
|
|
end
|
|
</pre>
|
|
<p>After one more compile, you can now launch the application and point your browser to <a href="http://localhost:9090">http://localhost:9090</a>.
|
|
You should now see a simple page with <i>Hello World</i>.</p>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="footer">
|
|
<p>© EiffelWebFramework 2013</p>
|
|
</div>
|
|
</div> <!-- /container -->
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="js/bootstrap.min.js"></script>
|
|
<script src="js/run_prettify.js"></script>
|
|
<script src="js/lang-eiffel.js"></script>
|
|
</body>
|
|
</html>
|