mirror of https://github.com/dirtbags/moth.git
Serving theme files
This commit is contained in:
parent
ffc705ec8b
commit
53947e2d64
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/namsral/flag"
|
||||
"flag"
|
||||
"github.com/spf13/afero"
|
||||
"log"
|
||||
"mime"
|
||||
|
@ -47,7 +47,7 @@ func main() {
|
|||
)
|
||||
bindStr := flag.String(
|
||||
"bind",
|
||||
":8000",
|
||||
":8080",
|
||||
"Bind [host]:port for HTTP service",
|
||||
)
|
||||
base := flag.String(
|
||||
|
@ -55,6 +55,7 @@ func main() {
|
|||
"/",
|
||||
"Base URL of this instance",
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
theme := NewTheme(afero.NewBasePathFs(afero.NewOsFs(), *themePath))
|
||||
state := NewState(afero.NewBasePathFs(afero.NewOsFs(), *statePath))
|
||||
|
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"github.com/spf13/afero"
|
||||
"time"
|
||||
"log"
|
||||
)
|
||||
|
||||
type Theme struct {
|
||||
|
@ -17,6 +18,7 @@ func NewTheme(fs afero.Fs) *Theme {
|
|||
|
||||
// I don't understand why I need this. The type checking system is weird here.
|
||||
func (t *Theme) Open(name string) (ReadSeekCloser, error) {
|
||||
log.Println(name)
|
||||
return t.Fs.Open(name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue