From 78032b3967c74a76bb9240bc73001161ed6b659e Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 3 Jan 2023 12:01:46 -0500 Subject: [PATCH] MiniDocsServer now inherits from Tealight. --- src/MiniDocs/MiniDocsServer.class.st | 48 +++++++++++++--------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/MiniDocs/MiniDocsServer.class.st b/src/MiniDocs/MiniDocsServer.class.st index 84209e7..054f92d 100644 --- a/src/MiniDocs/MiniDocsServer.class.st +++ b/src/MiniDocs/MiniDocsServer.class.st @@ -1,31 +1,18 @@ Class { #name : #MiniDocsServer, - #superclass : #Teapot, + #superclass : #TLWebserver, + #instVars : [ + 'storage' + ], #classInstVars : [ - 'storage', 'singleton' ], #category : #MiniDocs } -{ #category : #accessing } -MiniDocsServer class >> addStorage: anObject [ - self storage add: anObject. -] - -{ #category : #accessing } -MiniDocsServer class >> initialize [ - self addStorage: FileLocator documents / 'lepiter' / 'default' -] - -{ #category : #accessing } -MiniDocsServer class >> isRunning [ - ^ self singleton server isRunning -] - { #category : #accessing } MiniDocsServer class >> restart [ - self stopAll. + Teapot stopAll. ^ self start ] @@ -35,19 +22,28 @@ MiniDocsServer class >> singleton [ ] { #category : #accessing } -MiniDocsServer class >> start [ - self initialize. - ^ singleton := self superclass on - serveStatic: '/lepiter/doc/' from: self storage first pathString; - start +MiniDocsServer >> addStorage: anObject [ + self storage add: anObject. ] { #category : #accessing } -MiniDocsServer class >> storage [ - ^ storage ifNil: [ storage := OrderedCollection new] +MiniDocsServer >> initialize [ + super initialize. + self storage: FileLocator documents / 'lepiter' / 'default' ] { #category : #accessing } -MiniDocsServer class >> storage: aFoldersOrderedCollection [ +MiniDocsServer >> start [ + self initTeapot. + super start. +] + +{ #category : #accessing } +MiniDocsServer >> storage [ + ^ storage +] + +{ #category : #accessing } +MiniDocsServer >> storage: aFoldersOrderedCollection [ storage := aFoldersOrderedCollection ]