mirror of
https://github.com/jimeh/ozu.io.git
synced 2026-02-19 08:06:39 +00:00
Fix epic typo :O
This commit is contained in:
@@ -5,19 +5,19 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/jimeh/ozu.io/shortner"
|
||||
"github.com/jimeh/ozu.io/shortener"
|
||||
"github.com/qiangxue/fasthttp-routing"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
// Handlers handle HTTP requests.
|
||||
type Handlers struct {
|
||||
s *shortner.Shortner
|
||||
s *shortener.Shortener
|
||||
}
|
||||
|
||||
// Index handles requests for root.
|
||||
func (h *Handlers) Index(c *routing.Context) error {
|
||||
c.WriteString("Welcome to ozu.io, a shitty URL shortner.")
|
||||
c.WriteString("Welcome to ozu.io, a shitty URL shortener.")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/jimeh/ozu.io/shortner"
|
||||
"github.com/jimeh/ozu.io/shortener"
|
||||
"github.com/qiangxue/fasthttp-routing"
|
||||
)
|
||||
|
||||
// NewRouter creates a new routing.Router with all handlers registered.
|
||||
func NewRouter(shortner *shortner.Shortner) *routing.Router {
|
||||
func NewRouter(shortener *shortener.Shortener) *routing.Router {
|
||||
router := routing.New()
|
||||
handlers := Handlers{shortner}
|
||||
handlers := Handlers{shortener}
|
||||
|
||||
router.Get("/", handlers.Index)
|
||||
router.Get("/api/shorten", handlers.Shorten)
|
||||
|
||||
Reference in New Issue
Block a user