框架网页(网页设计框架)
文章目录[隐藏]
- 1、Go Frame框架学习
- 2、下载gf-cli(Go Frame开发工具链)
- 3、需求分析创建数据库
- 4、构建初始化项目
- 5、编写配置文件(默认在config下)
框架网页(网页设计框架)
简称gf
下载地址
https://github.com/gogf/gf-cli【脚手架工具】
1、Go Frame框架学习
官方文档
-
1
Go Frame 框架官方网站
2、下载gf-cli(Go Frame开发工具链)
工具开源项目地址,提供了各种操作系统版本和安装方法
完整命令
-
1
D:\\goland\\代码区\\test1>gfUSAGE gf COMMAND [ARGUMENT] [OPTION]COMMAND env show current Golang environment variables get install or update GF to system in default... gen automatically generate go files for ORM models... mod extra features for go modules... run running go codes with hot-compiled-like feature... init create and initialize an empty GF project... help show more information about a specified command pack packing any file/directory to a resource file, or a go file... build cross-building go project for lots of platforms... docker create a docker image for current GF project... swagger swagger feature for current project... update update current gf binary to latest one (might need root/admin permission) install install gf binary to system (might need root/admin permission) version show current binary version infoOPTION -y all yes for all command without prompt ask -?,-h show this help or detail for specified command -v,-i show version informationADDITIONAL Use 'gf help COMMAND' or 'gf COMMAND -h' for detail about a command, which has '...' in the tail of their comments.
3、需求分析创建数据库
数据库自行根据自身所做网站构建。
-
1
4、构建初始化项目
D:\\goland\\代码区\\web>gf init web
-
1
5、编写配置文件(默认在config下)
# HTTP Server配置[server] Address = ":8119" //端口号 ServerRoot = "/" //静态资源路径 FileServerEnabled = true SessionMaxAge = "30min"# Logger.[logger] Path = "/tmp/log/yj-app" Level = "all" Stdout = true# Template.[viewer] Path = "template" DefaultFile = "index.html" Delimiters = ["{{", "}}"]# Database configurations.[database] link = "mysql:root:root@tcp(localhost:3306)/goframe_test" //账号:root 密码:root 数据库:goframe_testdebug = true# 数据库日志对象配置[database.logger] Path = "/tmp/log/gf-demos/sql"Level = "all"Stdout = true