Achieve — High Level Logic Project. Creating a new meta design pattern.

Friendly in development. Fast in production. Just build your apps. Let Achieve do the rest.

← Back to technical specifications

Achieve Static Resources

Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2

Achieve serves files directly from the configured application space. A file's URL follows its application-relative path, while containment checks and protected server-side suffixes keep routing inside the application boundary.

Application-space lookup

achieve.setAppPath(path.join(__dirname, "application"));
achieve.listen(8989);

A request for /images/logo.png resolves beneath that application root. Query data participates in request processing but not the filesystem name. Directory requests without a trailing slash are redirected so relative resources resolve correctly. With a trailing slash, Achieve checks its established index-file sequence, including HTML documents and supported servlet index files.

Automatic lookup and explicit route maps share the same physical-containment checks. Traversal, absolute-path injection, protected servlet source, and internal compression-cache paths are not exposed as ordinary static content. Routing details are documented in Application-Space Routing.

Media types and resource classes

Achieve has built-in MIME mappings for common text, application, image, audio, and video types. addMimeType() registers an ordinary static type; addAVMimeType() registers an audiovisual type that uses media streaming and byte-range behavior. An existing ordinary static file with an unregistered suffix is served with Content-Type: text/plain.

Descriptor-based delivery

For an ordinary static representation, Achieve opens the final selected file, obtains metadata with fstat, and streams from that same descriptor. Content length, validators, and transmitted bytes therefore describe the opened representation rather than a separate pathname lookup. Descriptor cleanup covers normal completion, precondition responses, errors, and aborted transfers.

Audiovisual resources use the media path, including automatic byte-range handling. Ordinary static files support validators, conditional requests, and optional gzip or deflate representations, but a Range field does not invoke Achieve's automatic byte-range handling for them.

Response behavior

Successful responses include the selected content type, exact representation length, and server metadata. Missing resources produce 404; denied cross-origin or protected access produces 403; an unacceptable representation produces 406; and an open or transmission failure produces a controlled error when the response can still be replaced.

Related facilities

Verification and limits

Static lookup, containment, descriptor, length, validator, range, compression, abort, and failure tests cover HTTP, HTTPS, h2c, and secure HTTP/2 where applicable. The static-lookup regression explicitly verifies the unknown-suffix text/plain fallback and unchanged response bytes over its HTTP fixture. Application filesystem permissions and the correctness of custom MIME registrations remain deployment responsibilities.