moon

command module
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 6 Imported by: 0

README

Moon Boilerplate

Moon Boilerplate has been developed to make powerful and fast web applications.

⚡️ Quickstart


go get -u github.com/ferdiunal/moon

cd $GOPATH/src/github.com/ferdiunal/moon

cp .env.example .env

nano .env


APP_NAME="Moon Boilerplate"
APP_PORT=3000
APP_KEY=

DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=moon
DB_USERNAME=root
DB_PASSWORD=

HASH_ID_KEY=
HASH_ID_LENGTH=8


package main

import (
	"github.com/ferdiunal/moon/src"
	"github.com/ferdiunal/moon/src/controllers"
	"github.com/ferdiunal/moon/src/middlewares"
	"github.com/ferdiunal/moon/src/models"
)

func Routes(router *src.Server) *src.Server {
	router.Route("POST", "/auth/login", controllers.NewLoginController)
	router.Route("POST", "/auth/register", controllers.NewRegisterController)

	router.Route("GET", "/", controllers.NewIndexController, middlewares.NewTokenVerify)
	return router
}

func main() {
	app := src.NewApplication()
	app.AutoMigrate(
		&models.User{},
		&models.PersonalAccessToken{},
	)
	server := src.NewServer(app)
	Routes(
		server.Init(),
	).Run()
}

🥇 Feature

  • Mars (Authentication provider inspired by Laravel Sanctum.)
  • Venus

🔬Third-Party Libraries

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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