mirror of
https://github.com/ssep1ol/overleaf-registration-be.git
synced 2026-07-21 20:40:21 +00:00
First commit
This commit is contained in:
28
main.go
Normal file
28
main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Load environment variables
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
log.Println("No .env file found, using environment variables")
|
||||
}
|
||||
|
||||
// Register the HTTP handler
|
||||
http.HandleFunc("/register", RegisterHandler)
|
||||
|
||||
// Start the HTTP server
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "3000"
|
||||
}
|
||||
log.Printf("Server running on port %s\n", port)
|
||||
log.Fatal(http.ListenAndServe(":"+port, nil))
|
||||
}
|
||||
Reference in New Issue
Block a user