🎉 first commit

This commit is contained in:
2024-01-19 16:11:54 +04:00
commit f59cb4f927
22 changed files with 667 additions and 0 deletions

27
app/http_handlers/base.go Normal file
View File

@@ -0,0 +1,27 @@
package httpHandlers
import (
"github.com/aykhans/oh-my-url/app/db"
"github.com/aykhans/oh-my-url/app/utils"
"log"
"net/http"
)
type HandlerCreate struct {
DB db.DB
ForwardDomain string
}
type HandlerForward struct {
DB db.DB
CreateDomain string
}
func FaviconHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, utils.GetTemplatePaths("favicon.ico")[0])
}
func InternalServerError(w http.ResponseWriter, err error) {
log.Fatal(err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
}