Achieve Server Configuration and Startup
Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2
Achieve separates startup configuration from application resources. The application space is mandatory; optional settings select modes, logging, caching, compression, input limits, MIME types, CORS, routes, and registered methods.
Minimal startup
const achieve = require("achieve");
achieve.setAppPath("./application");
achieve.listen(8989);setAppPath() resolves and validates an existing directory and its physical path. Achieve has no default application space and will not start a listener until one has been configured.
Listeners
listen(port)creates HTTP/1.1.slisten(options)creates HTTPS and requires key and certificate.listen2(port)creates cleartext HTTP/2 prior-knowledge service.listen2(options)creates secure HTTP/2 and requires key and certificate.
Port values are normalized and constrained by Achieve's listener rules; an omitted port uses the protocol default. Each method returns the Node server when startup succeeds.
Startup-locked choices
Mode, persistent logging selection, and log path must be selected before the listener. Logging sinks are initialized before listen; failure to create an enabled sink prevents startup rather than silently disabling the requested configuration. The configured application path is revalidated at startup.
Independent settings
Achieve mode and NODE_ENV are separate. Caching and compression default off. Persistent logging defaults off. The buffered POST limit defaults to 1 MiB and accepts only a positive safe integer below Achieve's heap-based ceiling. Route, path, CORS, MIME, and method registrations have their own validation.
Startup reporting and verification
On listening, Achieve reports protocol, port, versions, entry path, application path, modes, cache/compression/input settings, logs, MIME counts, character set, CORS policies, mappings, and registered methods. Configuration, logging, routing, MIME, method, and four-transport fixtures verify accepted and rejected startup states. See the Configuration Reference.
