Starting default views.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-29 21:46:34 -05:00
parent a96dd95359
commit f3a1927615
1 changed files with 28 additions and 1 deletions

View File

@ -9,6 +9,30 @@ Class {
#category : #Brea
}
{ #category : #accessing }
BreaApp >> appName [
^ self name asCamelCase
]
{ #category : #accessing }
BreaApp >> defaultView [
^ '<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="css/pico.min.css">
<title>Hello from', self appName, '</title>
</head>
<body>
<main class="container">
<h1>Hello world!</h1>
</main>
</body>
</html>'
]
{ #category : #accessing }
BreaApp >> folder [
^ folder
@ -21,7 +45,10 @@ BreaApp >> folder: aFileDirectory [
{ #category : #accessing }
BreaApp >> launch [
^ MiniDocsServer singleton
| defaultRoute |
defaultRoute := 'http://localhost:',self server server port asString, '/', self appName.
self server GET: self appName -> self defaultView.
GoogleChrome openWindowOn: defaultRoute
]
{ #category : #accessing }