Giter Site home page Giter Site logo

web's Introduction

webgo

a golang web framework for vectors ERP system

框架提供关于Http服务器端最精简逻辑实现,理论上可以兼容大部分其他框架中间件(需要小量修改)

##QQ Group 151120790

服务器目录树
App
│
├─module 应用模块目录
│  ├─web 模块目录
│  │  ├─static 静态资源目录
│  │  │   ├─uploads 上传根目录
│  │  │   ├─lib 资源库文件目录(常用作前端框架库)
│  │  │   └─src 资源文件
│  │  │      ├─js 资源Js文件目录
│  │  │      ├─img 资源图片文件目录
│  │  │      └─css 资源Css文件
│  │  ├─model 模型目录
│  │  ├─template 视图文件目录
│  │  ├─data 数据目录
│  │  ├─model 模型目录
│  │  └─controller.go 控制器
│  │
│  ├─base 模块目录
│  │
│  └─... 扩展的可装卸功能模块或插件
│
├─static 静态资源目录
│  ├─uploads 上传根目录
│  ├─lib 资源库文件目录(常用作前端框架库)
│  └─src 资源文件
│     ├─js 资源Js文件目录
│     ├─img 资源图片文件目录
│     └─css 资源Css文件
├─template 视图文件目录
├─deploy 部署文件目录
│
├─main.go 主文件
└─main.ini 配置文件

hello world demo

package main

import (
	"fmt"

	"github.com/VectorsOrigin/web"
)

type (
	ctrls struct {
	}
)

func (self ctrls) hello_world(hd *web.THandler) {
	hd.RespondString("Hello Webgo World!")
}

func main() {
	srv := web.NewServer("")
	srv.Get("/hello", ctrls.hello_world)
	srv.Get("/hello2", func(c *web.THandler) {
		c.RespondString("Hello, World")
		return
	})

	srv.Get("/hello3", func(c *web.THandler) {
		c.RenderTemplate("hello_world.html", map[string]interface{}{"static": "youpath"})
		fmt.Println("b", c.Route.FilePath)
		return
	})

	srv.Listen(":8080")
}

web's People

Contributors

hzmsrv avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.