diff options
author | knotteye <knotteye@airmail.cc> | 2021-07-02 14:20:16 -0500 |
---|---|---|
committer | knotteye <knotteye@airmail.cc> | 2021-07-02 14:20:16 -0500 |
commit | faae38726dd804e3246514d88f93794c23a0cdb2 (patch) | |
tree | 4671606919340098b81c398e8478ba616a0432b1 /main.go | |
parent | ad5f4e9ff7e7ab0abab4a964cbf1626d0cdc3365 (diff) |
show only the last 3 news items on index, link to a page with all news items
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -293,6 +293,12 @@ func main() { http.HandleFunc("/news/", func(w http.ResponseWriter, r *http.Request){ timestamp := r.URL.Path[6:] + + if(len(timestamp) < 2) { + AllNewsGet(w, r, db) + return + } + if timestamp[len(timestamp)-1:] == "/" { timestamp = timestamp[:len(timestamp)-1] } |