implemented http server

This commit is contained in:
Altair-sh
2026-11-02 21:47:34 +01:00
parent e0cf8a12a9
commit bac4ccb34e
14 changed files with 775 additions and 178 deletions
+18
View File
@@ -0,0 +1,18 @@
package http
import (
"mime"
"path"
)
const MimeDefault = "application/octet-stream"
const TextPlain = "text/plain; charset=utf-8"
const TextHtml = "text/html; charset=utf-8"
func GetMimeType(filePath string) string {
t := mime.TypeByExtension(path.Ext(filePath))
if t == "" {
t = MimeDefault
}
return t
}