扫描打开手机站
随时逛,及时抢!
当前位置:首页>综合资讯>

框架网页(网页设计框架)

框架网页(网页设计框架)

时间:2021-04-13 20:16:18 来源:百思特网 作者:best456

框架网页(网页设计框架)

简称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&nb百思特网sp;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

GO Frame框架搭建一个web网站(一)


GO Frame框架搭建一个web网站(一)


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


本文地址:https://www.best73.com/zdmzt/87185.html
特别声明:以上内容来源于编辑整理发布,如有不妥之处,请与我方联系删除处理。
热门资讯
查看更多