* Refactored several modules for better readability * Removed deprecated functions and variables * Improved overall project organization
Static Files
This directory contains the embedded static files for the WhatsHooked landing page.
Files
index.html- Landing page with API documentationlogo.png- WhatsHooked logo (fromassets/image/whatshooked_tp.png)
How It Works
These files are embedded into the Go binary using go:embed directive in static.go.
When you build the server:
go build ./cmd/server/
The files in this directory are compiled directly into the binary, so the server can run without any external files.
Updating the Landing Page
-
Edit the HTML:
vim pkg/handlers/static/index.html -
Rebuild the server:
go build ./cmd/server/ -
Restart the server:
./server -config bin/config.json
The changes will be embedded in the new binary.
Updating the Logo
-
Replace the logo:
cp path/to/new-logo.png pkg/handlers/static/logo.png -
Rebuild:
go build ./cmd/server/
Routes
GET /- Servesindex.htmlGET /static/logo.png- Serveslogo.pngGET /static/*- Serves any file in this directory
Development Tips
- Files are cached with
Cache-Control: public, max-age=3600(1 hour) - Force refresh in browser:
Ctrl+Shift+RorCmd+Shift+R - Changes require rebuild - no hot reload
- Keep files small - they're embedded in the binary
File Structure
pkg/handlers/
├── static.go # Handler with go:embed directive
├── static/
│ ├── index.html # Landing page
│ ├── logo.png # Logo image
│ └── README.md # This file
Benefits of Embedded Files
✅ Single binary deployment - No external dependencies ✅ Fast serving - Files loaded from memory ✅ No file system access - Works in restricted environments ✅ Portable - Binary includes everything ✅ Version controlled - Static assets tracked with code