MiniDocsServer now inherits from Tealight.
This commit is contained in:
parent
f3171fa09e
commit
78032b3967
@ -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
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user