All Projects → gramework → Gramework

gramework / Gramework

Licence: apache-2.0
Fast and Reliable Golang Web Framework

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gramework

Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (-30.51%)
Mutual labels:  rest-api, restful-api, web-framework, high-performance, fast
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-49.72%)
Mutual labels:  rest-api, rest, restful-api, web-framework, high-performance
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (-58.76%)
Mutual labels:  framework, web-framework, easy-to-use, high-performance
Farwest
Framework for building RESTful HATEOAS-driven applications.
Stars: ✭ 18 (-94.92%)
Mutual labels:  rest-api, rest, restful-api, web-framework
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-58.76%)
Mutual labels:  rest-api, rest, restful-api
Codeigniter Jwt Sample
CodeIgniter JWT Sample
Stars: ✭ 144 (-59.32%)
Mutual labels:  rest-api, rest, restful-api
Hikaku
A library that tests if the implementation of a REST-API meets its specification.
Stars: ✭ 154 (-56.5%)
Mutual labels:  rest-api, rest, restful-api
Fiber
⚡️ Express inspired web framework written in Go
Stars: ✭ 17,334 (+4796.61%)
Mutual labels:  rest-api, framework, fast
Go Codon
Workflow based REST framework code generator
Stars: ✭ 133 (-62.43%)
Mutual labels:  rest-api, rest, web-framework
Finale
Create flexible REST endpoints and controllers from Sequelize models in your Express app
Stars: ✭ 167 (-52.82%)
Mutual labels:  rest-api, rest, restful-api
Json Server Heroku
Deploy json-server to Heroku & Azure 🆙 🆓
Stars: ✭ 310 (-12.43%)
Mutual labels:  rest-api, rest, restful-api
Api Generator
Api Generator是一款可以自动解析Controller类抽取REST接口信息并自动上传YApi的IDEA插件。YApi好伴侣,从此维护文档再也不是事儿了!
Stars: ✭ 139 (-60.73%)
Mutual labels:  rest-api, rest, restful-api
Open Rest
Standard rest server, Base on restify and sequelize
Stars: ✭ 136 (-61.58%)
Mutual labels:  rest-api, rest, restful-api
Appkernel
API development made easy: a smart Python 3 API framework
Stars: ✭ 152 (-57.06%)
Mutual labels:  rest-api, rest, restful-api
Sandman2
Automatically generate a RESTful API service for your legacy database. No code required!
Stars: ✭ 1,765 (+398.59%)
Mutual labels:  rest-api, rest, restful-api
Stampede
🦕 Deno REST framework/eco-system
Stars: ✭ 205 (-42.09%)
Mutual labels:  rest-api, rest, framework
Blogbackendproject
Backend code for my blogs, develop with Django Rest framework.
Stars: ✭ 204 (-42.37%)
Mutual labels:  rest-api, rest, restful-api
Magic
Create your .Net Core/Angular/Database CRUD Web apps by simply clicking a button
Stars: ✭ 214 (-39.55%)
Mutual labels:  rest-api, rest, framework
Evolutility Server Node
Model-driven REST or GraphQL backend for CRUD and more, written in Javascript, using Node.js, Express, and PostgreSQL.
Stars: ✭ 84 (-76.27%)
Mutual labels:  rest-api, rest, restful-api
Automatic Api
A list of software that turns your database into a REST/GraphQL API
Stars: ✭ 1,583 (+347.18%)
Mutual labels:  rest-api, rest, restful-api

Gramework

codecov Build Status CII Best Practices Backers on Open Collective Sponsors on Open Collective FOSSA Status Reviewed by Hound

The Good Framework

Gramework Stats Screenshot

Gramework long-term testing stand metrics screenshot made with Gramework Stats Dashboard and metrics middleware

What is it?

Gramework is a fast, highly effective, reliable, SPA-first, go-way web framework made by a fasthttp maintainer. You get the simple yet powerful API, we handle optimizations internally. We're always glad to see your feature requests and PRs.


Reasons to use Gramework

  • Gramework has a stable API.
  • Gramework is battle-tested.
  • Gramework is made by a maintainer of fasthttp.
  • Gramework is one of the rare frameworks that can help you use your server's resources more efficiently.
  • Gramework lowers your infrastructure costs by using as little memory as possible.
  • Gramework helps you serve requests faster, and so it helps you increase conversions (source 1, source 2).
  • With Gramework you can build software faster using a simple yet powerful and highly optimized API.
  • With Gramework you get enterprise-grade support and answers to all your questions.
  • At the Gramework team, we respect our users.
  • You can directly contact the maintainer and donate for high priority feature.
  • You can be sure that all license questions are OK with gramework.

Go >= 1.10.8 is the oldest continously tested and supported version.

Useful links and info

If you encounter any vulnerabilities then please feel free to submit them via [email protected].

Name Link/Badge
Docs GoDoc
Our Jira Jira
License Report Report
Changelog Changelog
Support us with a donation or become a sponsor OpenCollective
Our Telegram chat @gramework
Our #gramework channel in the Gophers Slack https://gophers.slack.com
Our Discord Server https://discord.gg/HkW8DsD
Master branch coverage codecov
Master branch status Build Status
Dev branch coverage codecov
Dev branch status Build Status
CII Best Practices CII Best Practices
Gramework Stats Dashboard for Grafana https://grafana.com/dashboards/3422
Support contacts Via email: [email protected]
Via Telegram community: @gramework

Table of Contents

Benchmarks

benchmark

Contributors

This project exists thanks to our awesome contributors! [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

3rd-party license info

  • Gramework is now powered by fasthttp and an embedded custom fasthttprouter. You will find the according licenses in /third_party_licenses/fasthttp and /third_party_licenses/fasthttprouter.
  • The 3rd autoTLS implementation, placed in nettls_*.go, is an integrated version of caddytls, because using it through a simple import isn't an option, gramework is based on fasthttp, which is incompatible with net/http. In the commit I based on, caddy is Apache-2.0 licensed. Its license placed in /third_party_licenses/caddy. @mholt allow us to copy the code in this repo.

FOSSA Status

Basic usage

Hello world

The example below will serve "hello, grameworld". Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", "hello, grameworld")

	app.ListenAndServe()
}

If you don't want to support the bind flag then pass the optional address argument to ListenAndServe.

NOTE: all examples below will register the bind flag.

JSON world ;) Part 1

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the map. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", func() map[string]interface{} {
		return map[string]interface{}{
			"hello": "gramework",
		}
	})

	app.ListenAndServe()
}

JSON world. Part 2

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the struct. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

type SomeResponse struct {
	hello string
}

func main() {
	app := gramework.New()

	app.GET("/", func() interface{} {
		return SomeResponse{
			hello: "gramework",
		}
	})

	app.ListenAndServe()
}

Serving a dir

The example below will serve static files from ./files:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/*any", app.ServeDir("./files"))

	app.ListenAndServe()
}

Serving prepared bytes

The example below will serve a byte slice:

package main

import (
	"fmt"
	"os"
	"time"

	"github.com/gramework/gramework"
)

type SomeData struct {
	Name string
	Age  uint8
}

func main() {
	app := gramework.New()

	d := SomeData{
		Name: "Grame",
		Age:  20,
	}

	// service-wide CORS. you can also instead of using middleware
	// call ctx.CORS() manually
	app.Use(app.CORSMiddleware())

	app.GET("/someJSON", func(ctx *gramework.Context) {
		// send json, no metter if user asked for json, xml or anything else.
		if err := ctx.JSON(d); err != nil {
			// you can return err instead of manual checks and Err500() call.
			// See next handler for example.
			ctx.Err500()
		}
	})

	app.GET("/simpleJSON", func(ctx *gramework.Context) error {
		return ctx.JSON(d)
	})

	app.GET("/someData", func(ctx *gramework.Context) error {
		// send data in one of supported encodings user asked for.
		// Now we support json, xml and csv. More coming soon.
		sentType, err := ctx.Encode(d)
		if err != nil {
			ctx.Logger.WithError(err).Error("could not process request")
			return err
		}
		ctx.Logger.WithField("sentType", sentType).Debug("some request-related message")
		return nil
	})

	// you can omit context if you want, return `interface{}`, `error` or both.
	app.GET("/simplestJSON", func() interface{} {
		return d
	})

	// you can also use one of built-in types as a handler, we got you covered too
	app.GET("/hostnameJSON", fmt.Sprintf(`{"hostname": %q}`, os.Hostname()))

	wait := make(chan struct{})
	go func() {
		time.Sleep(10 * time.Minute)
		app.Shutdown()
		wait <- struct{}{}
	}()

	app.ListenAndServe()

	// allow Shutdown() to stop the app properly.
	// ListenAndServe will return before Shutdown(), so we should wait.
	<-wait
}

Using dynamic handlers, example 2. Simple FastHTTP-compatible handlers.

This example demonstrates how to migrate from fasthttp to gramework without rewriting your handlers.

package main

import (
	"github.com/gramework/gramework"
	"github.com/valyala/fasthttp"
)

func main() {
	app := gramework.New()

	app.GET("/someJSON", func(ctx *fasthttp.RequestCtx) {
		ctx.WriteString("another data")
	})

	app.ListenAndServe()
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].