Gofish is a simple HTTP server for uploading, listing, downloading, and serving images.
- Upload images via HTTP POST
- List all uploaded images
- Download images by filename
- Serve images directly via URL
- Simple HTML frontend (optional)
- Go 1.18 or newer
Clone the repository:
git clone https://github.com/yourusername/gofish.git
cd gofish
go build -o gofish
./gofish
The server will start on http://localhost:8080
by default.
Send a POST request to /upload
with a form field named file
:
curl -F "file=@yourimage.png" http://localhost:8080/upload
Visit http://localhost:8080/list
or send a GET request to /list
to get a JSON array of filenames.
Access http://localhost:8080/images/<filename>
to view or download an image.
Visit http://localhost:8080/
for a simple web interface (if enabled).
Method | Endpoint | Description |
---|---|---|
POST | /upload |
Upload an image |
GET | /images |
List all images |
GET | /images/<filename> |
View an image |
GET | /download/<filename> |
Download an image |
GET | / |
HTML frontend (optional) |
- Images are stored in the
images/
directory by default. - Static files (frontend) are served from
static/
. - To change the port, set the
PORT
environment variable:
PORT=9090 ./gofish
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
MIT