Starting implementation of default app view body.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-30 10:24:17 -05:00
parent 72e0c775e5
commit 81298aefba
1 changed files with 8 additions and 4 deletions

View File

@ -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
]