aboutsummaryrefslogtreecommitdiff
path: root/internal/generate
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-04-06 03:00:22 +0700
committerShulhan <m.shulhan@gmail.com>2020-04-06 03:00:22 +0700
commitdb5b35cd5052d47c81bb63f78f7781513be22fd2 (patch)
treec393a2aa937a0b576a9f25c10b76dd8967a90b02 /internal/generate
parent5ea27bffa9020ddcdc62774a29e399e76ae5997c (diff)
downloadkamusku-db5b35cd5052d47c81bb63f78f7781513be22fd2.tar.xz
www-kbbi: add content page for "/project/kbbi"
The content page show the definition and capabilities of the API.
Diffstat (limited to 'internal/generate')
-rw-r--r--internal/generate/main.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/generate/main.go b/internal/generate/main.go
new file mode 100644
index 0000000..cb12ccf
--- /dev/null
+++ b/internal/generate/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"
+
+ "github.com/shuLhan/share/lib/memfs"
+)
+
+func main() {
+ includes := []string{
+ "index.html",
+ "index.js",
+ "kbbiclient.js",
+ }
+
+ mfs, err := memfs.New(includes, nil, true)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ err = mfs.Mount("./_content")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ mfs.GoGenerate("main", "./cmd/www-kbbi/static.go", memfs.EncodingGzip)
+}