diff options
| author | Shulhan <m.shulhan@gmail.com> | 2020-03-31 01:11:26 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2020-04-01 06:28:03 +0700 |
| commit | 8a141995aabdee289d2b096bd77a10b52b08a1bf (patch) | |
| tree | 98af569d4c3e2620809ce591c2733184cd77db8f /cmd | |
| parent | 84fdfdb6ae4175a125fc67a6aed377476d31ee0e (diff) | |
| download | kamusku-8a141995aabdee289d2b096bd77a10b52b08a1bf.tar.xz | |
all: implement server and client for dictionary API
Currently the server and client can onyl handle API for looking up
definitions of the words through "/api/definisi" URL.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/www-kbbi/main.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cmd/www-kbbi/main.go b/cmd/www-kbbi/main.go new file mode 100644 index 0000000..bb4cd86 --- /dev/null +++ b/cmd/www-kbbi/main.go @@ -0,0 +1,31 @@ +// Copyright 2020, Shulhan <m.shulhan@gmail.com>. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "log" + "os" + "os/signal" + + "github.com/shuLhan/kbbi" +) + +func main() { + server, err := kbbi.NewServer() + if err != nil { + log.Fatal(err) + } + + go func() { + err = server.Start() + if err != nil { + log.Println(err) + } + }() + + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + <-c +} |
