BANjO is a simple web framework written in Go (golang)

BANjO

Build Status Software License GoDoc Coverage Status Go Report Card

banjo it's a simple web framework for building simple web applications

Install

$ go get github.com/nsheremet/banjo

Example Usage

Simple Web App - main.go

package main

import "banjo"

func main() {
  app := banjo.Create(banjo.DefaultConfig())
  
  app.Get("/", func(ctx *banjo.Context) {
    ctx.JSON(banjo.M{"foo":"bar"})
  })

  app.Run()
}

Example responses:

// ... Redirect To
  app.Get("/admin", func(ctx *banjo.Context) {
    ctx.RedirectTo("/")
  })
// ... HTML
  app.Get("/foo", func(ctx *banjo.Context) {
    ctx.HTML("<h1>Hello from BONjO!</h1>")
  })
// ... Return Params as JSON
  app.Post("/bar", func(ctx *banjo.Context) {
    ctx.JSON(banjo.M{
      "params": ctx.Request.Params
    })
    ctx.Response.Status = 201
  })

License

banjo is primarily distributed under the terms of Mozilla Public License 2.0.

See LICENSE for details.

Owner
Nazarii Sheremet
Husband, Geek, Software Engineer
Nazarii Sheremet
Similar Resources

A powerful go web framework for highly scalable and resource efficient web application

A powerful go web framework for highly scalable and resource efficient web application

Oct 3, 2022

A web app built using Go Buffalo web framework

Welcome to Buffalo Thank you for choosing Buffalo for your web development needs. Database Setup It looks like you chose to set up your application us

Feb 7, 2022

A gin-like simple golang web framework.

webgo A gin-like simple golang web framework.

Aug 24, 2022

A gin-like simple golang web framework.

A gin-like simple golang web framework.

Aug 24, 2022

⚡️ Express inspired web framework written in Go

⚡️ Express inspired web framework written in Go

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development w

Jan 2, 2023

Gearbox :gear: is a web framework written in Go with a focus on high performance

Gearbox :gear: is a web framework written in Go with a focus on high performance

gearbox ⚙️ is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x fa

Jan 3, 2023

go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero English | 简体中文 0. what is go-zero go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the

Jan 2, 2023

Gearbox :gear: is a web framework written in Go with a focus on high performance

Gearbox :gear: is a web framework written in Go with a focus on high performance

gearbox ⚙️ is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x fa

Dec 29, 2022

Simple and lightweight Go web framework inspired by koa

Simple and lightweight Go web framework inspired by koa

VOX A golang web framework for humans, inspired by Koa heavily. Getting started Installation Using the go get power: $ go get -u github.com/aisk/vox B

Dec 14, 2022
Comments
  • /hello/:name return 404

    /hello/:name return 404

    package main
    
    import (
    	"github.com/n4Zz2/banjo"
    )
    
    func main() {
    	app := banjo.Create(banjo.DefaultConfig())
     	app.Get("/hello/:name", func(ctx *banjo.Context) {
    		ctx.JSON(banjo.M{"foo": "bar"})
    	})
    
    	app.Run()  // 4321
    }
    
    

    $ curl http://localhost:4321/hello/aaa Page Not Found

  •  ctx.HTML  run only  last

    ctx.HTML run only last

    package main
    
    import (
    "github.com/n4Zz2/banjo"
    
    )
    func main() {
      app := banjo.Create(banjo.DefaultConfig())
        app.Get("/foo", func(ctx *banjo.Context) {
        ctx.HTML("<b> banjo</b>")
        ctx.HTML("<h1>Hello from BONjO!</h1>")
      })
      
     
    
      app.Run()
    }
    
  •   imports banjo: import cycle not allowed

    imports banjo: import cycle not allowed

    package main
    
    import (
    "banjo"
    
    )
    func main() {
      app := banjo.Create(banjo.DefaultConfig())
      
      app.Get("/", func(ctx *banjo.Context) {
        ctx.JSON(banjo.M{"foo":"bar"})
      })
    
      app.Run()
    }
    
Related tags
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

Nov 14, 2022
The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

Jul 14, 2022
⚡ Rux is an simple and fast web framework. support middleware, compatible http.Handler interface. 简单且快速的 Go web 框架,支持中间件,兼容 http.Handler 接口

Rux Simple and fast web framework for build golang HTTP applications. NOTICE: v1.3.x is not fully compatible with v1.2.x version Fast route match, sup

Dec 8, 2022
Gin is a HTTP web framework written in Go (Golang).
Gin is a HTTP web framework written in Go (Golang).

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Jan 3, 2023
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance. Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance.  Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。

Tigo(For English Documentation Click Here) 一个使用Go语言开发的web框架。 相关工具及插件 tiger tiger是一个专门为Tigo框架量身定做的脚手架工具,可以使用tiger新建Tigo项目或者执行其他操作。

Jan 5, 2023
Umeshu is a mini web framework written by Golang.

Umeshu Umeshu is a mini web framework written by Golang. Purpose Why do I reinvent the wheel? Just for learning. ?? Building a mini web framework from

Jul 2, 2022
burn is a web framework written in golang to develop backend / restapi

burn burn rest api framework About: burn is a web framework written in golang to

Dec 27, 2021
Roche is a Code Generator and Web Framework, makes web development super concise with Go, CleanArch
Roche is a Code Generator and Web Framework, makes web development super concise with Go, CleanArch

It is still under development, so please do not use it. We plan to release v.1.0.0 in the summer. roche is a web framework optimized for microservice

Sep 19, 2022
A powerful go web framework for highly scalable and resource efficient web application

webfr A powerful go web framework for highly scalable and resource efficient web application Installation: go get -u github.com/krishpranav/webfr Exa

Nov 28, 2021