diff options
| author | Fuwn <[email protected]> | 2021-07-14 23:06:33 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-14 23:06:33 +0000 |
| commit | 2ead92e075ecdceec9be7c852ad318299bc8d87e (patch) | |
| tree | 00c85a647830929ce8b3993bfb48e4b2154baff7 /route.go | |
| parent | feat(space): :gemini: (diff) | |
| download | space-2ead92e075ecdceec9be7c852ad318299bc8d87e.tar.xz space-2ead92e075ecdceec9be7c852ad318299bc8d87e.zip | |
feat(database): persistant hits
Diffstat (limited to 'route.go')
| -rw-r--r-- | route.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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(), }) }) |