From 2d811e9f3859eb2d6232f4f29722540417c8cf5e Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 30 Mar 2024 18:06:16 -0500 Subject: [PATCH] Default server shared with the one serving MiniDocs. --- repository/Brea/BreaApp.class.st | 11 ++++++----- repository/Brea/String.extension.st | 2 +- repository/Brea/Teapot.extension.st | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 repository/Brea/Teapot.extension.st diff --git a/repository/Brea/BreaApp.class.st b/repository/Brea/BreaApp.class.st index ad1c7a8..cc70765 100644 --- a/repository/Brea/BreaApp.class.st +++ b/repository/Brea/BreaApp.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'name', 'folder', - 'server', + 'host', 'componets' ], #category : #Brea @@ -77,8 +77,9 @@ BreaApp >> folder: aFileDirectory [ { #category : #accessing } BreaApp >> launch [ | defaultRoute | - defaultRoute := 'http://localhost:',self server server port asString, '/', self appName. - self server GET: self appName -> [ self defaultView ]. + defaultRoute := 'http://localhost:',self webHost server port asString, '/', self appName. + self webHost + GET: self appName -> [ self defaultView ]. GoogleChrome openWindowOn: defaultRoute ] @@ -98,6 +99,6 @@ BreaApp >> parentFolder: anObject [ ] { #category : #accessing } -BreaApp >> server [ - ^ server ifNil: [ server := MiniDocsServer singleton ] +BreaApp >> webHost [ + ^ host ifNil: [ host := Teapot allInstances detect: [ :each | each webHost isRunning ]] ] diff --git a/repository/Brea/String.extension.st b/repository/Brea/String.extension.st index 448ac73..edba3ae 100644 --- a/repository/Brea/String.extension.st +++ b/repository/Brea/String.extension.st @@ -2,5 +2,5 @@ Extension { #name : #String } { #category : #'*Brea' } String >> webView [ - ^ Pandoc htmlStringToMarkdown: self + ^ (Pandoc htmlStringToMarkdown: self) accentedCharactersCorrection ] diff --git a/repository/Brea/Teapot.extension.st b/repository/Brea/Teapot.extension.st new file mode 100644 index 0000000..99e5436 --- /dev/null +++ b/repository/Brea/Teapot.extension.st @@ -0,0 +1,6 @@ +Extension { #name : #Teapot } + +{ #category : #'*Brea' } +Teapot >> dynamicRoutes [ + ^ dynamicRouter routes +]