server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package server wires the API, short-link redirector, and embedded SPA behind a single http.Handler.

Routing:

  • /api/* → JSON API
  • /admin/* → embedded React dashboard (assets + SPA fallback)
  • / → redirect to /admin/
  • /{slug} → short-link redirect (the root namespace belongs to links)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the top-level HTTP handler.

func New

func New(cfg *config.Config, apiHandler http.Handler, short *shortlink.Service, webFS fs.FS) (*Server, error)

New builds the combined handler. webFS is the embedded dist directory.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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