statik allows you to embed a directory of static files into your Go binary to be later served from an http.FileSystem. Is this a crazy idea? No, not necessarily. If you're building a tool that has a Web component, you typically want to serve some images, CSS and JavaScript. You like the comfort of distributing a single binary, so you don't want to mess with deploying them elsewhere. If your static files are not large in size and will be browsed by a few people, statik is the solution you are looking for. statik is a tiny program that reads a directory and generates a source file that contains its contents. The generated source file registers the directory contents to be used by statik file system. In your program, all your need to do is to import the generated package, initialize a new statik file system and serve.

Features

  • By default, statik includes the "last modified" (mtime) time on files that it packs
  • Allows an HTTP FileServer to present the correct file modification times to clients
  • You can also read the content of a single file
  • statik is a tiny program that reads a directory and generates a source file that contains its contents
  • The generated source file registers the directory contents to be used by statik file system
  • The command below will walk on the public path and generate a package called statik under the current working directory

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

Apache License V2.0

Follow statik

statik Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of statik!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-13