initial commit
This commit is contained in:
21
lib/server.go
Normal file
21
lib/server.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package lib
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type StatusBotServer struct {
|
||||
}
|
||||
|
||||
func (server *StatusBotServer) createThreadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
bot := &StatusBotSender{}
|
||||
bot.SendCreateThreadRequest()
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func (server *StatusBotServer) Start() {
|
||||
http.HandleFunc("/create-thread", server.createThreadHandler)
|
||||
log.Println("Starting server on :8080")
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
Reference in New Issue
Block a user