Last active
February 10, 2019 19:29
-
-
Save CodebyOmar/c7770bb3b43e830948b82cddc35694c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"tutorial/3factor-chatapp/notifications" | |
"tutorial/3factor-chatapp/rooms" | |
"github.com/joho/godotenv" | |
) | |
func main() { | |
err := godotenv.Load() | |
if err != nil { | |
log.Fatal("Error loading .env file") | |
} | |
addr := ":5070" | |
http.HandleFunc("/addtorooms", rooms.AddToRooms) | |
http.HandleFunc("/send/notification", notifications.SendPushNotifications) | |
log.Println("listening on", addr) | |
log.Fatal(http.ListenAndServe(addr, nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment