aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/server.go b/server.go
index ec4aedd..e0e6b9c 100644
--- a/server.go
+++ b/server.go
@@ -39,9 +39,10 @@ type Server struct {
}
//
-// NewServer create and initialize the server.
+// NewServer create and initialize the server with optional path to dictionary
+// storage.
//
-func NewServer() (server *Server, err error) {
+func NewServer(kamusStorage string) (server *Server, err error) {
opts := &http.ServerOptions{
Address: defListen,
}
@@ -50,7 +51,7 @@ func NewServer() (server *Server, err error) {
stopped: make(chan bool, 1),
}
- server.kamus, err = newKamusCache("")
+ server.kamus, err = newKamusCache(kamusStorage)
if err != nil {
return nil, fmt.Errorf("http.NewServer: %w", err)
}