Git Product home page Git Product logo

wedge's Introduction

WEDGE IS DEPRECATED AND IS NO LONGER BEING DEVELOPED

LPT: DO NOT USE. LEFT HERE AS A MONUMENT TO MY SINS.

Wedge

Wedge is intended to cut-down on the boilerplate when creating dead simple webapps. There's no super over-the-top functionality in the majority of webapps I've seen yet we all write the same boring code.

Wedge, for the time being, will allow you to write simple functions which do simple things. You need a function on a URL? No problem. You want to easily write a simple JSON response for a URL? No problem! You want to have a multi-tiered RPC cluster with flash failover support and other such magic? Use the standard library and write it yourself, Wedge would not be a good fit.

Features:

  • Easily set up functions to hang off URLs.
  • Static files retrieval on any URL, cached.
  • Cache URLs permanently or for a specified time.
  • Form processing.
  • Custom 404/500 handlers.
  • Statistics tracking.
  • Not much else.

Usage:

// Main page
func Index(w http.ResponseWriter, req *http.Request) (string, int) {
    return "Hello world!", http.StatusOK
}

func Page404(w http.ResponseWriter, req *http.Request) (string, int) {
    return "An oopsie!", http.StatusNotFound
}

func main() {

    App := wedge.NewAppServer(12345, 30)
    App.AddURLs(
        wedge.Favicon(filepath.Join(DIRNAME, "static", "favicon.ico")),
        wedge.StaticFiles("/static/", filepath.Join(DIRNAME, "static/")),
        wedge.URL("^/awesome/$", "Getting awesome", Awsum, wedge.HTML),
        wedge.CacheURL("^/$", "Index", Index, wedge.HTML, -1),
    )
    App.Handler404(Page404)
    App.EnableStatTracking()      // stat tracking on ^/statistics/?$
    App.Run()
}

wedge's People

Contributors

aeronotix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rand cstrouse

wedge's Issues

Form elements are printed out of order

Due to a minor implementation detail for some Field types, they are displayed out of order.

This will be a minor fix but I am marking it as 'not too pressing'.

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.