Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Repository files navigation

GoDoc

ZipFS for net/http

Installation

$ go get github.com/cjtoolkit/zipfs

Example

package main
import (
"fmt""log""net/http""github.com/cjtoolkit/zipfs"
)
funcmain() {
// Init ZipFS, if the zip file does not exist it will fallback to embedded zip file within application, if that// also does not exist, it will panic.fs:=zipfs.InitZipFs("asset.zip")
fmt.Println("Running ZipFS via http server on port 8080.")
log.Print(http.ListenAndServe(":8080", http.FileServer(fs)))
}

To embed zip to the application, first create a zip file with your preferred achiever with compression disabled. Than append the content of the zip file to the compiled application. You can use this simple shell command to append.

$ cat asset.zip >> application

Credit

This project is based on the work of the following:

About

🤐 ZipFS for net/http

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages