aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-07-14 23:06:33 +0000
committerFuwn <[email protected]>2021-07-14 23:06:33 +0000
commit2ead92e075ecdceec9be7c852ad318299bc8d87e (patch)
tree00c85a647830929ce8b3993bfb48e4b2154baff7 /route.go
parentfeat(space): :gemini: (diff)
downloadspace-2ead92e075ecdceec9be7c852ad318299bc8d87e.tar.xz
space-2ead92e075ecdceec9be7c852ad318299bc8d87e.zip
feat(database): persistant hits
Diffstat (limited to 'route.go')
-rw-r--r--route.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/route.go b/route.go
index a30ef68..9a41956 100644
--- a/route.go
+++ b/route.go
@@ -4,6 +4,7 @@
package main
import (
+ "github.com/fuwn/space/pkg/database"
"github.com/fuwn/space/pkg/utilities"
"github.com/pitr/gig"
)
@@ -13,7 +14,7 @@ func createRoute(route string, template string, content string) {
return c.Render(template, IndexTemplate{
Content: GetContent(content),
Quote: utilities.GetRandomQuote(),
- Hits: hitsTracker[route] + 1,
+ Hits: database.Get(route) + 1,
Copyright: utilities.GetCopyright(),
})
})
@@ -25,7 +26,7 @@ func createErrorRoute(route string, template string, content string, err string)
Error: err,
Content: GetContent(content),
Quote: utilities.GetRandomQuote(),
- Hits: hitsTracker[route] + 1,
+ Hits: database.Get(route) + 1,
Copyright: utilities.GetCopyright(),
})
})