Skip to content
/ web Public

A Go web app framework with views for constructing web pages, supports CGI & FCGI.

Notifications You must be signed in to change notification settings

duzy/web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

daf7ba0 · May 22, 2023
May 22, 2023
Mar 20, 2011
Nov 24, 2018
Mar 20, 2011
Feb 26, 2011
Feb 20, 2011
Mar 20, 2011
Feb 26, 2011
Nov 24, 2018
Feb 26, 2011
Feb 26, 2011
Feb 26, 2011
Feb 20, 2011
Feb 26, 2011
Feb 13, 2011
Feb 20, 2011
Feb 13, 2011
Feb 26, 2011

Repository files navigation

web

A Go web app framework with views for constructing web pages, supports CGI & FCGI.

package main

import (
        "web"
        "fmt"
        "os"
)

var counter = 0

func hello(request *web.Request, response *web.Response) (err os.Error) {
        counter += 1
        response.Header.Set("Content-Type", "text/html")
        fmt.Fprintf(response.BodyWriter, "<b>test</b>: <small>num=%d</small><br/>\n", counter)
        return
}

func main() {
        m, err := web.NewFCGIModel()
        if err != nil {
                fmt.Printf("%v\n", err)
                return
        }

        app, err := web.NewApp(m)
        if err != nil {
                fmt.Printf("%v\n", err)
                return
        }

        if app == nil {
                fmt.Printf("no app\n")
                return
        }

        app.HandleDefault(web.FuncHandler(hello))
        app.Exec()
}

About

A Go web app framework with views for constructing web pages, supports CGI & FCGI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published