Skip to content

komorebi8/ghttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghttp

A http server based on github.com/panjf2000/gnet.

It can be used like net/http.

An example:

package main

import (
	"fmt"
	"github.com/kunnpuu/ghttp"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintln(w, "hello http server")
	})
	http.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintln(w, "pong")
	})
	// replace http.ListenAndServe() with ghttp.ListenAndServe()
	ghttp.ListenAndServe(":8080", nil)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages