Build and Test Dependency Graph pre-release tagged-release
Core is a Go framework for fast API prototyping built on:
fasthttp(server)github.com/qiangxue/fasthttp-routing(router)
Core is configured via a JSON file loaded into the Config struct.
SPC_ENV(preferred): selects the config file<env>.json(default:dev)SPC_CONFIG(preferred): absolute path to a config file (overridesSPC_ENV)
Backward compatible fallbacks are still accepted:
SPK_ENVSPK_CONFIG
package main import ( "log" core "github.com/sphireinc/core/v1" ) func main() { app, err := core.New() if err != nil { log.Fatal(err) } if err := app.Run(); err != nil { log.Fatal(err) } }
Example app code lives under cmd/example/
Handlers use this signature:
func handler(ctx *core.Context) error { return core.HandleResponseJSON(ctx, []byte(`{}`), 200) }
Register routes before Run():
app.Router.Get("/our-custom-route", handler)
When enabled, Core uses github.com/go-echarts/statsview.
- :18066/debug/statsview