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

View File

@ -4,7 +4,8 @@ Class {
#instVars : [ #instVars : [
'name', 'name',
'folder', 'folder',
'server' 'server',
'body'
], ],
#category : #Brea #category : #Brea
} }
@ -14,6 +15,11 @@ BreaApp >> appName [
^ self name asCamelCase ^ self name asCamelCase
] ]
{ #category : #accessing }
BreaApp >> body [
^ body ifNil: [ body := '' writeStream contents ]
]
{ #category : #accessing } { #category : #accessing }
BreaApp >> defaultView [ BreaApp >> defaultView [
^ '<!doctype html> ^ '<!doctype html>
@ -27,8 +33,7 @@ BreaApp >> defaultView [
</head> </head>
<body> <body>
<main class="container"> <main class="container">
<h1>', self name, '</h1> ', self body, '
<p>Probando<p>
</main> </main>
</body> </body>
</html>' </html>'
@ -48,7 +53,6 @@ BreaApp >> folder: aFileDirectory [
BreaApp >> launch [ BreaApp >> launch [
| defaultRoute | | defaultRoute |
defaultRoute := 'http://localhost:',self server server port asString, '/', self appName. defaultRoute := 'http://localhost:',self server server port asString, '/', self appName.
"self server removeAllDynamicRoutes."
self server GET: self appName -> [ self defaultView ]. self server GET: self appName -> [ self defaultView ].
GoogleChrome openWindowOn: defaultRoute GoogleChrome openWindowOn: defaultRoute
] ]