v1.0.6

Mastering Static Files: Middleware and 100% Test Coverage

Serving static assets efficiently is a cornerstone of web development. Today, we're introducing the staticFiles middleware for Fastro—a robust solution designed for performance and reliability.

Key Features

The new static middleware isn't just a simple file server. It's built with modern production requirements in mind:

Engineering Excellence: 100% Coverage

Software reliability is non-negotiable at Fastro. To ensure the staticFiles middleware works flawlessly under all conditions, we've implemented a comprehensive test suite.

Using the Deno.test runner and @std/testing/time's FakeTime, we've achieved 100% test coverage for both lines and branches.

What we tested:

How to Use

Adding static file support to your Fastro app is now easier than ever:

import { Fastro } from "https://deno.land/x/fastro/mod.ts";
import { staticFiles } from "https://deno.land/x/fastro/middlewares/static/static.ts";

const app = new Fastro();

// Serve files from the 'public' folder at the '/static' URL prefix
app.use(staticFiles("/static", "./public", { spaFallback: true }));

await app.serve();

Conclusion

With the addition of the static middleware and our commitment to 100% test coverage, Fastro continues to provide a solid foundation for building high-performance web applications.

Stay tuned for more updates as we continue to refine the framework!