##1 安装GOLANG
到https://golang.google.cn/dl/上载下免安装的包go1.8.windows-amd64.zip,一定要1.8版本,高了不能用。
解压到 d:\app\go
增加环境变量
set GOARCH=amd64
set GOROOT=d:\app\go
set GOBIN=%GOROOT%\bin
set GOOS=windows
set GOPATH=D:\PERSONAL\go_work\data
set path=d:\app\go\bin;%path%
d:\app\go\bin> go version
###2 安装mongoDB
下载,解压
D:\app\mongodb-3.4.7\bin> mongod --dbpath D:\app\mongodb-3.4.7\data\db
直接按WinKey+R, 输入cmd 打开命令行
D:\app\mongodb-3.4.7\bin>mongo 127.0.0.1:27017/admin
###3 下载leanote源码
https://github.com/leanote/leanote-all/archive/master.zip
将src下面的内容复制到D:\PERSONAL\go_work\data\src下面
4 导入初始数据
D:\app\mongodb-3.4.7\bin>mongorestore -h localhost -d leanote --dir D:\PERSONAL\go_work\data\src\github.com\leanote\leanote\mongodb_backup\leanote_install_data
检查
D:\app\mongodb-3.4.7\bin>mongo 127.0.0.1:27017/admin
show dbs
admin 0.000GB
blog 0.000GB
leanote 0.001GB
…
注意:导入成功的数据已经包含2个用户
user1 username: admin, password: abc123 (管理员, 只有该用户可以管理后台)
user2 username: demo@leanote.com, password: demo@leanote.com (仅共体验使用)
安装?
D:\app\go\bin>go install github.com\revel\cmd\revel
换成1.8之后,这一步很慢,还多出了pkg这个目录
D:\app\go\bin>revel run github.com\leanote\leanote
之前把src放在d:\app\go\src\下面,编译错误
Unexpected! Code path is not in GOPATH: [31mpath[0m=d:\app\go\src\github.com\leanote\leanote\app
换了路径,还有编译错误
Build: `dep` executable not found in PATH, but vendor folder detected.Packages can only be added automatically to the vendor folder using the `dep` tool. You can install the `dep` tool by doing a `go get -u github.com/golang/dep/cmd/dep`
要安装dep
==============================
到 https://github.com/golang/dep/releases 下载dep-windows-amd64.exe
放入d:\app\go\bin下并改名为dep.exe
==================================
还是这个错误
[31mERROR[0m 16:18:37 revel build.go:379: Build errors [31merrors[0m=“D:\PERSONAL\go_work\data\src\github.com\leanote\leanote\app\tmp\main.go:19:2: must be imported as github.com/revel/modules/static/app/controllers\n”
最后把D:\PERSONAL\go_work\data\src\github.com\leanote\leanot\vendor目录删除才好。???
总算进来了 http://localhost:9000
admin还不能登录