feat(fonts): add fonts storage
This commit is contained in:
@@ -30,7 +30,7 @@ func HandleCommandline() {
|
||||
} else if help {
|
||||
flag.PrintDefaults()
|
||||
} else {
|
||||
svg.Storage = svg.NewFileStorage(datapath)
|
||||
svg.Storage = svg.NewFileStorage(datapath, "fonts")
|
||||
server.PrepareHTTP()
|
||||
server.Start()
|
||||
}
|
||||
|
||||
12
internal/routes/font.go
Normal file
12
internal/routes/font.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package routes
|
||||
|
||||
import "net/http"
|
||||
|
||||
func AddFont(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if r.Header.Get("Content-Type") != "font/ttf" {
|
||||
http.Error(w, "", http.StatusUnsupportedMediaType)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user