Added basic two basic examples, refactor rename restbucks
to restbucksCRUD
This commit is contained in:
31
examples/simple/application.e
Normal file
31
examples/simple/application.e
Normal file
@@ -0,0 +1,31 @@
|
||||
note
|
||||
description : "simple application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
make_and_launch
|
||||
end
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
-- To send a response we need to setup, the status code and
|
||||
-- the response headers.
|
||||
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||
res.write_header_text ("")
|
||||
res.write_string ("Hello World")
|
||||
end
|
||||
end
|
||||
24
examples/simple/simple.ecf
Normal file
24
examples/simple/simple.ecf
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="simple" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||
<target name="simple">
|
||||
<root class="APPLICATION" feature="make"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="connector_nino" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\ewsgi\connectors\nino\nino-safe.ecf"/>
|
||||
<library name="default_nino" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\wsf\default\nino-safe.ecf"/>
|
||||
<library name="http" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\protocol\http\http-safe.ecf"/>
|
||||
<library name="wsf" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\wsf\wsf-safe.ecf"/>
|
||||
<cluster name="simple" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="simple_dotnet" extends="simple">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
1
examples/simple/simple.rc
Normal file
1
examples/simple/simple.rc
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
13
examples/simple_file/home.html
Normal file
13
examples/simple_file/home.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
Eiffel REST services
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Welcome to the Eiffel REST services site, here you will find a lot of <br/>
|
||||
resources about REST and our solution
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
43
examples/simple_file/service_file.e
Normal file
43
examples/simple_file/service_file.e
Normal file
@@ -0,0 +1,43 @@
|
||||
note
|
||||
description : "simple application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
SERVICE_FILE
|
||||
|
||||
inherit
|
||||
DEFAULT_SERVICE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
make_and_launch
|
||||
end
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
l_file : RAW_FILE
|
||||
message : STRING
|
||||
h : WSF_HEADER
|
||||
do
|
||||
create l_file.make_open_read ("home.html")
|
||||
l_file.read_stream (l_file.count)
|
||||
message := l_file.last_string
|
||||
l_file.close
|
||||
|
||||
-- To send a response we need to setup, the status code and
|
||||
-- the response headers.
|
||||
create h.make
|
||||
h.put_content_type_text_html
|
||||
h.put_content_length (l_file.count)
|
||||
res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||
res.write_header_text (h.string)
|
||||
res.write_string (message)
|
||||
end
|
||||
end
|
||||
24
examples/simple_file/service_file.ecf
Normal file
24
examples/simple_file/service_file.ecf
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="service_file" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
|
||||
<target name="service_file">
|
||||
<root class="SERVICE_FILE" feature="make"/>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="connector_nino" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\ewsgi\connectors\nino\nino-safe.ecf"/>
|
||||
<library name="default_nino" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\wsf\default\nino-safe.ecf"/>
|
||||
<library name="http" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\protocol\http\http-safe.ecf"/>
|
||||
<library name="wsf" location="C:\Users\jvelilla\EiffelWorkspace\Eiffel-Web-Framework\library\server\wsf\wsf-safe.ecf"/>
|
||||
<cluster name="service_file" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="service_file_dotnet" extends="service_file">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
1
examples/simple_file/service_file.rc
Normal file
1
examples/simple_file/service_file.rc
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user