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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
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