mirror of
https://github.com/aykhans/oh-my-url.git
synced 2025-12-14 01:19:20 +00:00
🎉 first commit
This commit is contained in:
27
app/http_handlers/base.go
Normal file
27
app/http_handlers/base.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user