summaryrefslogtreecommitdiff
path: root/app/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/router.go')
-rw-r--r--app/router.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/router.go b/app/router.go
index 35550f8..2bcaf41 100644
--- a/app/router.go
+++ b/app/router.go
@@ -83,13 +83,15 @@ func Router() {
}
skunky.Endpoint = path[1]
+ skunky.API.skunkyartLink = &skunky
// пути
switch skunky.Endpoint {
default:
skunky.ReturnHTTPError(404)
+
case "":
- w.Write(open("html/index.htm"))
+ skunky.ExecuteTemplate("index.htm", "html", &CFG.URI)
case "post":
skunky.Deviation(path[2], path[3])
case "search":
@@ -120,6 +122,12 @@ func Router() {
w.Write(open("css/skunky.css"))
case "favicon.ico":
w.Write(open("images/logo.png"))
+
+ case "api":
+ switch path[2] {
+ case "random":
+ skunky.API.Random()
+ }
}
}