Categorygithub.com/PiterWeb/Alf-Router
modulepackage
0.0.0-20240104213556-8d3c2691da6e
Repository: https://github.com/piterweb/alf-router.git
Documentation: pkg.go.dev

# README

🦌 ALF (API Like Flutter) Router

šŸ”“ This library is actually well tested but the API may change with the time introducing breaking changes

Description

šŸ‘‰ This is a micro-framework / router built on ⬆ top of the fasthttp package. Alf relies on scalability and his simple structure wich is similar to Flutter projects šŸ““

✨ Inspired by Flutter & Fiber

Purpouse

šŸ‘·ā€ā™‚ļø Make a router to start faster and simpler my backend projects

šŸ“– Learn

  • Explore the fasthttp package ā­
  • Publish my own package šŸ“¦
  • Learn more deeply how a web server works 🌐

Technologies used šŸ“˜

  • Go (Golang)

Core External Packages šŸ“¦:

  1. fasthttp (http ☁)
  2. ffjson (parse interfaces to json fast)
  3. pterm (show info, errors & warnings)

Features :

  • Fast Router šŸ’Ø
  • Concurrent Route Setup ⌚
  • Send JSON Responses (docs)
  • HTML/Go Templates Out of the BOX ✨ (docs)
  • Plugins 🧩 :
    • Generate Types for TS (tygo pkg) (docs)

Docs

Prerequisites šŸ“Œ

Set up your first project šŸ’»

Download the package ⬇

go get github.com/PiterWeb/Alf-Router

Import it into your code šŸ” 

    import (
	    alf "github.com/PiterWeb/Alf-Router"
    )

Write this simple structure

    err := alf.App(&alf.AppConfig{
		Port: "3000",
		Routes: alf.CreateRouter([]alf.Route{
			{
				Path: "/",
				Handle: func(ctx *alf.Ctx) error {
					_, err := ctx.WriteString("Hello World")
					return err
				},
				Method: "get",
			},
		}),
	})

	if err != nil {
		panic(err)
	}

Now you have setup šŸ”Ø an index route

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
POST
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author