MiniDocsServer now inherits from Tealight.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-01-03 12:01:46 -05:00
parent f3171fa09e
commit 78032b3967

View File

@ -1,31 +1,18 @@
Class { Class {
#name : #MiniDocsServer, #name : #MiniDocsServer,
#superclass : #Teapot, #superclass : #TLWebserver,
#instVars : [
'storage'
],
#classInstVars : [ #classInstVars : [
'storage',
'singleton' 'singleton'
], ],
#category : #MiniDocs #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 } { #category : #accessing }
MiniDocsServer class >> restart [ MiniDocsServer class >> restart [
self stopAll. Teapot stopAll.
^ self start ^ self start
] ]
@ -35,19 +22,28 @@ MiniDocsServer class >> singleton [
] ]
{ #category : #accessing } { #category : #accessing }
MiniDocsServer class >> start [ MiniDocsServer >> addStorage: anObject [
self initialize. self storage add: anObject.
^ singleton := self superclass on
serveStatic: '/lepiter/doc/' from: self storage first pathString;
start
] ]
{ #category : #accessing } { #category : #accessing }
MiniDocsServer class >> storage [ MiniDocsServer >> initialize [
^ storage ifNil: [ storage := OrderedCollection new] super initialize.
self storage: FileLocator documents / 'lepiter' / 'default'
] ]
{ #category : #accessing } { #category : #accessing }
MiniDocsServer class >> storage: aFoldersOrderedCollection [ MiniDocsServer >> start [
self initTeapot.
super start.
]
{ #category : #accessing }
MiniDocsServer >> storage [
^ storage
]
{ #category : #accessing }
MiniDocsServer >> storage: aFoldersOrderedCollection [
storage := aFoldersOrderedCollection storage := aFoldersOrderedCollection
] ]