Starting implementation of default app view body.
This commit is contained in:
parent
72e0c775e5
commit
81298aefba
@ -4,7 +4,8 @@ Class {
|
||||
#instVars : [
|
||||
'name',
|
||||
'folder',
|
||||
'server'
|
||||
'server',
|
||||
'body'
|
||||
],
|
||||
#category : #Brea
|
||||
}
|
||||
@ -14,6 +15,11 @@ BreaApp >> appName [
|
||||
^ self name asCamelCase
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaApp >> body [
|
||||
^ body ifNil: [ body := '' writeStream contents ]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaApp >> defaultView [
|
||||
^ '<!doctype html>
|
||||
@ -27,8 +33,7 @@ BreaApp >> defaultView [
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<h1>', self name, '</h1>
|
||||
<p>Probando<p>
|
||||
', self body, '
|
||||
</main>
|
||||
</body>
|
||||
</html>'
|
||||
@ -48,7 +53,6 @@ BreaApp >> folder: aFileDirectory [
|
||||
BreaApp >> launch [
|
||||
| defaultRoute |
|
||||
defaultRoute := 'http://localhost:',self server server port asString, '/', self appName.
|
||||
"self server removeAllDynamicRoutes."
|
||||
self server GET: self appName -> [ self defaultView ].
|
||||
GoogleChrome openWindowOn: defaultRoute
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user