19 lines
404 B
Go
19 lines
404 B
Go
package server
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
func Start() error {
|
|
// Simple fasthttp server for now
|
|
requestHandler := func(ctx *fasthttp.RequestCtx) {
|
|
ctx.SetContentType("text/html; charset=utf-8")
|
|
fmt.Fprintf(ctx, "<h1>Dragon Knight</h1><p>Server is running!</p>")
|
|
}
|
|
|
|
log.Println("Server starting on :8080")
|
|
return fasthttp.ListenAndServe(":8080", requestHandler)
|
|
} |