gobase

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 10 Imported by: 0

README

gobase

godoc - documentation go report card codecov - code coverage github action - test

gobase is a web framework with basic settings and structure, wrapping fiber.

Installation

go get github.com/cancue/gobase

Example

package main

import (
	"github.com/cancue/gobase"
	"github.com/cancue/gobase/config"
	"github.com/gofiber/fiber/v2"
)

func main() {
	config := config.Config{
		Stage:        "local",
		Name:         "gobase",
		Domain:       "localhost",
		Port:         3000,
		AllowOrigins: []string{"http://localhost:3000"},
	}

	gobase.Start(&config, router)
}

func router(app *fiber.App) {
	app.Get("/", func(ctx *fiber.Ctx) error {
		return ctx.SendString("Hello, World 👋!")
	})
}

Demo

gobase-demo

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start added in v0.3.0

func Start(conf *config.Config, router func(*fiber.App))

Start .

Types

type Router added in v0.3.0

type Router interface {
	Set(app *fiber.App)
}

Router .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL