基于 Gin 的 Go 前端组件化 web 框架 ego

码农软件 · 软件分类 · Web框架 · 2019-03-25 13:57:35

软件介绍

基于 Gin 的 Go (风格)轻量高效的前端组件化 web 框架,这是一项正在完善的工作

Ego 是一个用 Go 编写的全栈 Web 框架,轻量级和高效的前端组件解决方案

前端编译执行,不影响后端效率

安装:

go get -u gitee.com/veni0/ego

例子: https://gitee.com/veni0/ego/tree/master/examples/ego

路由:

package main

import (
    "gitee.com/veni0/ego"
)

func main() {

    router := ego.Classic()
    ego.UseRenders()

    router.GlobHTML("views/html/*")

    parArr := [5]int{1, 2, 3, 4, 5}
    router.EgoRouter("/head/", "head/head.html", ego.Map{
        "head":   "Test to load the HTML template",
        "parArr": parArr,
    })

    router.Run(":3100")
}
//package head   head.html

import (
	"icons"
	icon "icons/icon.vgo"
	)
//

效果图:

另外写了一个Json预览和测试页面:

package main

import (
    "gitee.com/veni0/ego"
)

const httpUrl string = "http://127.0.0.1:3000"

func main() {

  router := ego.Classic()

  router.Static("/js", "./views/js")
  router.Static("/src", "./views/src")
  router.GlobHTML("views/html/*")

  strUrl := httpUrl + "/test/hlist"
  paramMap := ego.Map{
    "lon":  "10.1010101",
    "lat":  "20.202020",
    "type": "1",
  }
  router.TestHtml(strUrl, paramMap)

  router.Run(":3100")
}


效果图:

本文地址:https://codercto.com/soft/d/2123.html

PHP for the World Wide Web, Second Edition (Visual QuickStart Gu

PHP for the World Wide Web, Second Edition (Visual QuickStart Gu

Larry Ullman / Peachpit Press / 2004-02-02 / USD 29.99

So you know HTML, even JavaScript, but the idea of learning an actual programming language like PHP terrifies you? Well, stop quaking and get going with this easy task-based guide! Aimed at beginning ......一起来看看 《PHP for the World Wide Web, Second Edition (Visual QuickStart Gu》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具