gin webapp 项目骨架
A Web develop project skeleton base on Gin which just for reference.
More efficiency,
Faster and clear,
Easier to deploy
Suitable for simple project. ko、kit、go-micro、kite are better choice for the middle and large project.
Via moroingo installer or use docker
go get github.com/chenhg5/morningo-installer
cd $GOPATH/src
$GOPATH/bin/morningo-installer --project-name webcd web
make depsmake testmake restartmakevisit by browser: http://localhost:4000/api/index
First build the executable file
make build # for Linux
make cross # for mac/windowsThen put files of the build in your server and set the path of log and static file(html/css/js),and run the executable file.If 80 port is not allowed to use,consider the nginx proxy,or use the gin middleware gin-reverseproxy instead, which has some example in routers.go. When the project start running, it will generate the pidfile in the root path of the project. Excute the following command to update your project.
kill -INT $(cat pid) && ./morningo # graceful stop the process and restart…https://github.com/chenhg5/morningo/blob/master/controllers/MainController.go
wrk -c100 -d30s -t4 http://localhost:4000/api/index
Running 30s test @ http://localhost:4000/api/index
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.03ms 4.17ms 72.72ms 89.95%
Req/Sec 7.40k 1.67k 11.20k 67.75%
884816 requests in 30.03s, 107.17MB read
Non-2xx or 3xx responses: 884816
Requests/sec: 29462.96
Transfer/sec: 3.57MB暂无开放 Issues,或尚未同步最近议题。