First of all, create an new
TestView
class as a subclass of HVTransientView
:HVTransientView subclass: #TestView
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Test'
Then, create a
default
method as follows:default
| canvas |
canvas := self canvas.
canvas html:
[canvas head: [canvas title text: 'Test!'].
canvas body:
[canvas h1 text: 'A test of HV2''s new Canvas system'.
canvas p text: 'This is a simple test of the latest HV2 version']].
^ canvas
To start the engine, type the following on a Workspace then DoIt:
TestView startOn: 8080.
As soon as the HV2 engine has started, you can point your browser to
http://localhost:8080/
. Here's a screenshot of what you'll see:.You should also note that you can omit the
^ canvas
expression in the default
method. If you do so, HV2 will retrieve the response from the TestView instance itself.