基于golang快速搭建后台管理中心

cg33 e73721dfb5 modify há 6 anos atrás
uploads 28b7348618 add upload há 6 anos atrás
vendor dad2b66d90 add vendor há 6 anos atrás
.gitignore dad2b66d90 add vendor há 6 anos atrás
Dockerfile 2001ab86b4 add dockerfile há 6 anos atrás
README.md e73721dfb5 modify há 6 anos atrás
admin.db 5f10eb9cb4 initial há 6 anos atrás
config.json 5f10eb9cb4 initial há 6 anos atrás
go.mod 5f10eb9cb4 initial há 6 anos atrás
main.go 5f10eb9cb4 initial há 6 anos atrás

README.md

go-admin example

A example show how to run go-admin. Just for reference, here to know more.

一个运行go-admin的例子。仅供参考,在这里了解更多。

Following three ways to run the code.

以下三种方法。建议go版本大于1.11使用模块加载,同时设置环境变量GOPROXY=http://goproxy.cn,版本低于1.11的盆友使用第二种方法。如果本机没有golang环境,可以使用docker。

use go module 使用模块加载依赖

step 1

git clone https://github.com/GoAdminGroup/example.git

step 2

cd example
GO111MODULE=on go run main.go

visit: http://localhost:9033/admin

use gopath 使用GOPATH加载依赖

step 1

cd $GOPATH && git clone https://github.com/GoAdminGroup/example.git

step 2

go get github.com/kardianos/govendor
cd $GOPATH/example
govendor sync

如果你在中国,因为各种原因导致用以上步骤进行下载安装依赖有问题,那么你可以直接从这里下载:vendor.zip

下载完解压到项目文件夹即可。

step 3

go run main.go

visit: http://localhost:9033/admin

use docker 使用docker

step 1

git clone https://github.com/GoAdminGroup/example.git

step 2

cd example
docker build -t go-admin-example .

step 3

docker run -p 9033:9033 -it -d go-admin-example /bin/bash -c "cd /go/src/app && GOPROXY=http://goproxy.cn GO111MODULE=on go run main.go"

visit: http://localhost:9033/admin