aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorknotteye <knotteye@airmail.cc>2021-07-01 17:56:04 -0500
committerknotteye <knotteye@airmail.cc>2021-07-01 17:56:04 -0500
commit4e3848cadbb3fd89b94a7ef24838173939d198db (patch)
tree06ea5434986b2b9c00e392a7d44b93d7eae23668 /main.go
parent638a03b458b71564b1db439e6386d7dbf2a5181c (diff)
Add a list of local boards and server news
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.go b/main.go
index 972e69e..037f240 100644
--- a/main.go
+++ b/main.go
@@ -598,6 +598,17 @@ func main() {
MakeActivityRequestOutbox(db, newActorActivity)
http.Redirect(w, r, "/" + *Key, http.StatusSeeOther)
})
+
+ http.HandleFunc("/" + *Key + "/postnews", func(w http.ResponseWriter, r *http.Request) {
+ var newsitem NewsItem
+
+ newsitem.Title = r.FormValue("title")
+ newsitem.Content = r.FormValue("summary")
+
+ WriteNewsToDB(db, newsitem)
+
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ })
http.HandleFunc("/verify", func(w http.ResponseWriter, r *http.Request){
if(r.Method == "POST") {