achieve-http-server 0.0.0-stage → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -0
- package/LICENSE +21 -0
- package/README.md +269 -3
- package/achieve.js +3412 -0
- package/package.json +73 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Achieve 3.1.5 (2026-12-06)
|
|
4
|
+
|
|
5
|
+
- Delegated HTTP/1.x CONNECT to application listeners on the native Node.js
|
|
6
|
+
servers returned by `listen()` and `slisten()`. Achieve no longer sends its
|
|
7
|
+
built-in CONNECT rejection. `registerMethod()` continues to reject CONNECT,
|
|
8
|
+
with a diagnostic that explains the server event. HTTP/2 handling is unchanged.
|
|
9
|
+
|
|
10
|
+
## Achieve 3.1.2
|
|
11
|
+
|
|
12
|
+
- Optimized eligible static-file resolution with a descriptor-first path,
|
|
13
|
+
improving small-file throughput by approximately 10–16% in the project
|
|
14
|
+
benchmarks while preserving same-handle metadata and content handling.
|
|
15
|
+
- Prevented ordinary static aliases from exposing protected servlet source
|
|
16
|
+
files after physical-path resolution.
|
|
17
|
+
- Added cross-platform regression coverage for containment, descriptor cleanup,
|
|
18
|
+
failure handling, and static-file filesystem operation counts.
|
|
19
|
+
|
|
20
|
+
## Achieve 3.1.1
|
|
21
|
+
|
|
22
|
+
- Revised the README to emphasize ease of use, optional production-oriented
|
|
23
|
+
features, and the published technical specifications and HTTP conformance
|
|
24
|
+
assessment.
|
|
25
|
+
- Corrected Windows port allocation in the package smoke-test utility while
|
|
26
|
+
preserving Linux qualification compatibility.
|
|
27
|
+
|
|
28
|
+
## Achieve 3.1.0
|
|
29
|
+
|
|
30
|
+
- Corrected HTTP 205 Reset Content responses so application-supplied content
|
|
31
|
+
is suppressed while native Node.js response lifecycle behavior is preserved.
|
|
32
|
+
- Omitted unnecessary representation metadata from successful matching
|
|
33
|
+
`If-Range` 206 Partial Content responses.
|
|
34
|
+
- Raised the minimum supported runtime to Node.js 24. Node.js 22 is no longer
|
|
35
|
+
supported; Node.js 24.22.2 is the specifically qualified release runtime.
|
|
36
|
+
- Improved HTTP/2 conformance by adopting the qualified newer Node.js runtime.
|
|
37
|
+
|
|
38
|
+
## Achieve 3.0.6
|
|
39
|
+
|
|
40
|
+
- Strengthened strong ETags with filesystem change and identity metadata already
|
|
41
|
+
available from the opened resource.
|
|
42
|
+
- Prevented stale gzip and deflate artifacts from being reused when source
|
|
43
|
+
modification times are preserved.
|
|
44
|
+
- Prevented background compression from publishing an artifact when source
|
|
45
|
+
metadata changes during compression.
|
|
46
|
+
|
|
47
|
+
## Achieve 3.0.5
|
|
48
|
+
|
|
49
|
+
- Fixed servlet error handling for HEAD requests so error responses do not
|
|
50
|
+
attempt to write a body.
|
|
51
|
+
- Improved compatibility with Node.js `rejectNonStandardBodyWrites` handling.
|
|
52
|
+
- Added regression coverage for synchronous and asynchronous servlet failures
|
|
53
|
+
across HTTP, HTTPS, h2c, and secure HTTP/2.
|
|
54
|
+
- Added the centered README tagline, “Friendly in development. Fast in
|
|
55
|
+
production.”
|
|
56
|
+
|
|
57
|
+
## Achieve 3.0.0
|
|
58
|
+
|
|
59
|
+
Achieve 3 modernizes the server for Node.js 22 while retaining its HTTP,
|
|
60
|
+
HTTPS, HTTP/2, static-resource, and JavaScript Servlet foundations.
|
|
61
|
+
|
|
62
|
+
- Added CommonJS and ESM servlet forms through `.jss`, `.jss.cjs`, and
|
|
63
|
+
`.jss.mjs`, unified servlet module loading, managed Promise and `async`
|
|
64
|
+
completion, and the `session.autoEnd` response-ownership API.
|
|
65
|
+
- Unified parsed query, form, and JSON input under `session.params`; added
|
|
66
|
+
configurable buffered input and application-managed streaming. Servlet
|
|
67
|
+
completion now preserves application-selected status codes and handles
|
|
68
|
+
empty, null, undefined, Promise, and HEAD results consistently.
|
|
69
|
+
- Added validated exact-route and longest-prefix subtree mappings, registered
|
|
70
|
+
handlers for additional HTTP methods, and configurable CORS policies.
|
|
71
|
+
- Made the application space explicit through `setAppPath()` and
|
|
72
|
+
`session.appPath`. Strengthened request-path and physical filesystem
|
|
73
|
+
containment for static resources, media, directory defaults, and servlets.
|
|
74
|
+
- Improved static-resource handling with representation-specific strong ETags,
|
|
75
|
+
HTTP-date validators, conditional-request precedence, multi-member Range
|
|
76
|
+
request handling, accurate representation lengths, compression negotiation and
|
|
77
|
+
protection of internal compression-cache artifacts.
|
|
78
|
+
- Strengthened request validation and failure recovery, including absolute-form
|
|
79
|
+
targets, HTTP/2 authority handling, aborted buffered input, servlet startup
|
|
80
|
+
failures, and response completion before and after headers are sent.
|
|
81
|
+
- Separated startup reporting, development diagnostics, persistent server
|
|
82
|
+
logging, and access logging, with improved application-focused servlet error
|
|
83
|
+
diagnostics.
|
|
84
|
+
- Raised the minimum Node.js version to 22. The npm package has no runtime
|
|
85
|
+
dependencies and contains only the server, package metadata, README,
|
|
86
|
+
changelog, and license.
|
|
87
|
+
- Added complete Getting Started and Reference documentation, prepared a
|
|
88
|
+
separately distributed Advanced Examples project, and added a reproducible
|
|
89
|
+
37-suite verifier with Windows and Linux CI coverage.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2026 Roger F. Gay
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,269 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<p><img src="https://highlevellogic.github.io/achieve/images/skyhigh1.jpg" alt="Achieve — High Level Logic Project"></p>
|
|
2
|
+
|
|
3
|
+
<p align="center"><strong><em>Friendly in development. Fast in production.</em></strong></p>
|
|
4
|
+
|
|
5
|
+
<h1><a id="achieve" name="achieve"></a>Achieve</h1>
|
|
6
|
+
|
|
7
|
+
<p>Achieve is a ready-to-use HTTP server that serves static content and executes backend JavaScript Servlets for dynamic content. Originally developed in 2018 as an easy-to-use server for education,
|
|
8
|
+
Achieve has evolved substantially. Version 3 provides more advanced features and has undergone extensive testing, analysis, and review for <ins><em>standards compliance, reliability, and performance</em></ins>.</p>
|
|
9
|
+
|
|
10
|
+
<p>This document provides a quick introduction and overview of Achieve's features. Tutorials, references, and examples are available in the
|
|
11
|
+
<a href="https://highlevellogic.github.io/achieve/index.htm">project documentation</a>.
|
|
12
|
+
Detailed documentation is also available in <a href="https://highlevellogic.github.io/achieve/specifications/index.htm">technical specifications and HTTP conformance assessment</a>.</p>
|
|
13
|
+
|
|
14
|
+
<p>Achieve was originally published on npm as <a href="https://www.npmjs.com/package/achieve">achieve</a>. The <code>achieve-http-server</code> package distributes the same server implementation under a second npm name.</p>
|
|
15
|
+
|
|
16
|
+
<h2><a id="introduction" name="introduction"></a>Introduction</h2>
|
|
17
|
+
|
|
18
|
+
<p>Achieve version 3.1 <a href="https://nodejs.org/en/download">requires Node.js 24 or newer</a>.</p>
|
|
19
|
+
|
|
20
|
+
<p>Install Achieve, <code>npm i achieve-http-server</code>, and it’s ready to serve.</p>
|
|
21
|
+
|
|
22
|
+
<p>Achieve has a variety of <a href="https://highlevellogic.github.io/achieve/reference/config.htm">configuration options</a>, but only 3 lines are required to run the server. Use either <code>require</code> or <code>import</code>. See <a href="https://highlevellogic.github.io/achieve/start/startup.htm">Starting the server</a> for more details.</p>
|
|
23
|
+
|
|
24
|
+
<pre><code>const achieve = require("achieve-http-server");
|
|
25
|
+
achieve.setAppPath("c:/myapps/");
|
|
26
|
+
achieve.listen(8989);</code></pre>
|
|
27
|
+
|
|
28
|
+
<p>In this example, the server is running HTTP. The port has been set to 8989. Application code is stored in <code>c:/myapps/</code>. So, if you have <code>index.html</code> in that directory, it will be served in response to <code>localhost:8989</code>. Content in subdirectories use URLs that follow the directory path, for example: <code>js/main.js</code> will map to <code>c:/myapps/js/main.js</code>.</p>
|
|
29
|
+
|
|
30
|
+
<p>Achieve also supports <a href="https://highlevellogic.github.io/achieve/start/startup.htm">HTTPS and HTTP/2</a> as well as <a href="https://highlevellogic.github.io/achieve/reference/routing.htm">custom routing options</a>.</p>
|
|
31
|
+
|
|
32
|
+
<p>Servlets are entry points into backend applications, written in either CommonJS or ESM, synchronous or asynchronous. See <a href="https://highlevellogic.github.io/achieve/start/servlets.htm">Your first servlet</a> for more details.</p>
|
|
33
|
+
|
|
34
|
+
<pre><code>exports.servlet = function (session) {
|
|
35
|
+
/* Your application code here */
|
|
36
|
+
}</code></pre>
|
|
37
|
+
|
|
38
|
+
<p>If your JavaScript servlet is <code>c:/myapps/servlets/hello.jss</code>, Achieve will load and execute in response to URL <code>servlets/hello.jss</code> – same default routing as static content. Ordinary standards apply, for example a GET request to that servlet could be <code>servlets/hello.jss?name=Richard</code>. Then the name Richard can be accessed using <code>session.params.name</code>.</p>
|
|
39
|
+
|
|
40
|
+
<p>Servlets have special features for keeping simple things very simple and safe and eliminating annoying distractions. But they also serve as entry points to complex backend development. Whatever you need to do. Consider the following simple servlet.</p>
|
|
41
|
+
|
|
42
|
+
<pre><code>exports.servlet = function (session) {
|
|
43
|
+
return "Hello World!";
|
|
44
|
+
}</code></pre>
|
|
45
|
+
|
|
46
|
+
<p>Achieve handles the HTTP response. Now modify the servlet and save the file without restarting the server.</p>
|
|
47
|
+
|
|
48
|
+
<pre><code>exports.servlet = function (session) {
|
|
49
|
+
let response = "Hello Big World!";
|
|
50
|
+
return response;
|
|
51
|
+
}</code></pre>
|
|
52
|
+
|
|
53
|
+
<p>In development mode (default), Achieve detects the change and automatically reloads the servlet. It also handles errors.</p>
|
|
54
|
+
|
|
55
|
+
<pre><code>exports.servlet = function (session) {
|
|
56
|
+
let response = "Hello Big // ERROR!!!
|
|
57
|
+
return response;
|
|
58
|
+
}</code></pre>
|
|
59
|
+
|
|
60
|
+
<p>The server doesn’t crash. A message is returned telling you where the error is. Just fix it and continue to work.</p>
|
|
61
|
+
|
|
62
|
+
<p>The <a href="https://highlevellogic.github.io/achieve/reference/session.htm">session object</a> parameter is helpful and powerful. Among other things, it provides access to the Node request and response objects. You can work directly with request streams, set response headers, and stream large amounts of data to clients. You can also take control of the HTTP response by setting <code>session.autoEnd = false</code>. This is only required when the servlet returns before an asynchronous operation finishes and a callback will complete the response, as in the following example.</p>
|
|
63
|
+
|
|
64
|
+
<pre><code>const fs = require("node:fs");
|
|
65
|
+
|
|
66
|
+
exports.servlet = function (session) {
|
|
67
|
+
session.autoEnd = false;
|
|
68
|
+
|
|
69
|
+
fs.readFile("message.txt", "utf8", function (err, data) {
|
|
70
|
+
if (err) {
|
|
71
|
+
session.response.statusCode = 500;
|
|
72
|
+
session.response.end("Unable to read file");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
session.response.end(data);
|
|
77
|
+
});
|
|
78
|
+
};</code></pre>
|
|
79
|
+
|
|
80
|
+
<h3><a id="servlet-filenames" name="servlet-filenames"></a><a id="commonjs-esm-synchronous-and-promise-results" name="commonjs-esm-synchronous-and-promise-results"></a>Servlet filenames</h3>
|
|
81
|
+
|
|
82
|
+
<p>The <code>.jss</code> extension identifies a JavaScript Servlet that Achieve executes but never serves as source code. An additional <code>.cjs</code> or <code>.mjs</code> extension specifies the JavaScript module format.</p>
|
|
83
|
+
|
|
84
|
+
<table>
|
|
85
|
+
<thead>
|
|
86
|
+
<tr><th>Filename</th><th>Module form</th></tr>
|
|
87
|
+
</thead>
|
|
88
|
+
<tbody>
|
|
89
|
+
<tr><td><code>example.jss</code></td><td>CommonJS servlet</td></tr>
|
|
90
|
+
<tr><td><code>example.jss.cjs</code></td><td>Explicit CommonJS servlet</td></tr>
|
|
91
|
+
<tr><td><code>example.jss.mjs</code></td><td>ES module servlet</td></tr>
|
|
92
|
+
</tbody>
|
|
93
|
+
</table>
|
|
94
|
+
|
|
95
|
+
<h2><a id="contents" name="contents"></a>Contents</h2>
|
|
96
|
+
|
|
97
|
+
<ul>
|
|
98
|
+
<li><a href="#http-https-and-http2">HTTP, HTTPS, and HTTP/2</a></li>
|
|
99
|
+
<li><a href="#built-in-static-file-serving">Built-in static file serving</a></li>
|
|
100
|
+
<li><a href="#etags-and-conditional-requests">ETags and conditional requests</a></li>
|
|
101
|
+
<li><a href="#automatic-http-compression">Automatic HTTP compression</a></li>
|
|
102
|
+
<li><a href="#media-streaming-and-byte-ranges">Media streaming and byte ranges</a></li>
|
|
103
|
+
<li><a href="#url-routing-and-path-mapping">URL routing and path mapping</a></li>
|
|
104
|
+
<li><a href="#query-parameters-forms-and-json">Query parameters, forms, and JSON</a></li>
|
|
105
|
+
<li><a href="#cross-origin-resource-sharing-cors">Cross-origin resource sharing (CORS)</a></li>
|
|
106
|
+
<li><a href="#built-in-and-custom-http-methods">Built-in and custom HTTP methods</a></li>
|
|
107
|
+
<li><a href="#server-logging-and-diagnostics">Server logging and diagnostics</a></li>
|
|
108
|
+
<li><a href="#live-development-reloading-and-production-mode">Live development reloading and production mode</a></li>
|
|
109
|
+
<li><a href="#testing-and-technical-review">Testing and technical review</a></li>
|
|
110
|
+
<li><a href="#tutorials-and-reference-documentation">Tutorials and reference documentation</a></li>
|
|
111
|
+
<li><a href="#advanced-application-examples">Advanced application examples</a></li>
|
|
112
|
+
<li><a href="#license">License</a></li>
|
|
113
|
+
</ul>
|
|
114
|
+
|
|
115
|
+
<p>See the <a href="https://highlevellogic.github.io/achieve/reference/servlets.htm">Servlet Reference</a> and <a href="https://highlevellogic.github.io/achieve/reference/session.htm">Session Object Reference</a>.</p>
|
|
116
|
+
|
|
117
|
+
<h2><a id="http-https-and-http2" name="http-https-and-http2"></a>HTTP, HTTPS, and HTTP/2</h2>
|
|
118
|
+
|
|
119
|
+
<p>Achieve supports HTTP/1.1, HTTPS, cleartext HTTP/2 (h2c), and secure HTTP/2. Select the listener appropriate to your deployment without building protocol handling into the application. Multiple listeners can share one configured application space when bound to distinct ports.</p>
|
|
120
|
+
|
|
121
|
+
<p>Achieve implements and regression-tests HTTP semantics including method dispatch, conditional requests, byte ranges, response status and body rules, CORS decisions, and protocol-specific listener behavior.</p>
|
|
122
|
+
|
|
123
|
+
<p>Listener forms and TLS options are documented in <a href="https://highlevellogic.github.io/achieve/start/startup.htm">Starting the server</a>.</p>
|
|
124
|
+
|
|
125
|
+
<h2><a id="built-in-static-file-serving" name="built-in-static-file-serving"></a>Built-in static file serving</h2>
|
|
126
|
+
|
|
127
|
+
<p>Place files in the configured application space and Achieve serves them directly, including directory defaults and appropriate MIME types. Servlet source is protected, and resolved paths remain within the application boundary. There is no static-file middleware to choose, configure, or maintain.</p>
|
|
128
|
+
|
|
129
|
+
<p>Static handling is built in; an application does not need to register a static middleware layer. See the <a href="https://highlevellogic.github.io/achieve/reference/static.htm">Static Resources Reference</a>.</p>
|
|
130
|
+
|
|
131
|
+
<h2><a id="etags-and-conditional-requests" name="etags-and-conditional-requests"></a>ETags and conditional requests</h2>
|
|
132
|
+
|
|
133
|
+
<p>Achieve can supply ETag and Last-Modified validators and evaluate conditional requests, allowing browsers and clients to reuse unchanged content and avoid unnecessary transfers. It handles the HTTP precondition rules for supported requests instead of leaving application code to implement them. Validators distinguish compressed and uncompressed representations.</p>
|
|
134
|
+
|
|
135
|
+
<h2><a id="automatic-http-compression" name="automatic-http-compression"></a>Automatic HTTP compression</h2>
|
|
136
|
+
|
|
137
|
+
<p>Enable compression and Achieve negotiates gzip or deflate for eligible resources, selects an acceptable representation, and manages its cached compressed artifacts. Applications do not need to perform content-encoding negotiation or compression themselves.</p>
|
|
138
|
+
|
|
139
|
+
<h2><a id="media-streaming-and-byte-ranges" name="media-streaming-and-byte-ranges"></a>Media streaming and byte ranges</h2>
|
|
140
|
+
|
|
141
|
+
<p>Achieve provides a configurable audio/video streaming path with single byte-range support, so clients can request a portion of a media file rather than always transferring the whole resource. It handles HEAD, partial-response status, range headers, and content lengths. Multipart byte-range responses are not supported. When a request specifies multiple ranges, Achieve serves the first satisfiable range as a single-part response.</p>
|
|
142
|
+
|
|
143
|
+
<h2><a id="url-routing-and-path-mapping" name="url-routing-and-path-mapping"></a>URL routing and path mapping</h2>
|
|
144
|
+
|
|
145
|
+
<p>Ordinary URLs map directly into the configured application space. Exact and subtree route mappings let you give resources public-facing URLs without moving files or writing dispatch code. Exact mappings take precedence; subtree mappings use the longest matching prefix.</p>
|
|
146
|
+
|
|
147
|
+
<p>Routing changes public names without weakening application-space containment. See the <a href="https://highlevellogic.github.io/achieve/reference/routing.htm">Routing Reference</a>.</p>
|
|
148
|
+
|
|
149
|
+
<h2><a id="query-parameters-forms-and-json" name="query-parameters-forms-and-json"></a>Query parameters, forms, and JSON</h2>
|
|
150
|
+
|
|
151
|
+
<p>Achieve makes GET query parameters available through <code>session.params</code> and parses supported POST form and JSON input into the same property, subject to a configurable size limit. Servlets can work with common inputs immediately, while other bodies remain accessible through the underlying Node.js request stream.</p>
|
|
152
|
+
|
|
153
|
+
<p>See the <a href="https://highlevellogic.github.io/achieve/start/input.htm">Handling Input</a> tutorial.</p>
|
|
154
|
+
|
|
155
|
+
<h2><a id="cross-origin-resource-sharing-cors" name="cross-origin-resource-sharing-cors"></a>Cross-origin resource sharing (CORS)</h2>
|
|
156
|
+
|
|
157
|
+
<p>Configure permitted origins and application-relative paths with <code>allowOrigins()</code>. Achieve handles matching cross-origin requests and preflight decisions in the server, instead of requiring each servlet to repeat CORS logic. Requests carrying an Origin header without a matching permission are refused.</p>
|
|
158
|
+
|
|
159
|
+
<p>Exact-origin policy maps are selected ahead of the wildcard-origin map, and path specificity is evaluated within the selected map. See <a href="https://highlevellogic.github.io/achieve/reference/config.htm#allowOrigins">CORS configuration</a> for the precise forms and precedence rules.</p>
|
|
160
|
+
|
|
161
|
+
<h2><a id="built-in-and-custom-http-methods" name="built-in-and-custom-http-methods"></a>Built-in and custom HTTP methods</h2>
|
|
162
|
+
|
|
163
|
+
<p>Achieve handles GET, HEAD, POST, and OPTIONS directly. For additional standard or application-defined methods, register a servlet that implements the required behavior—such as a DELETE operation with application-specific authorization—without writing a new method dispatcher.</p>
|
|
164
|
+
|
|
165
|
+
<pre><code>achieve.registerMethod("DELETE", "methods/delete.jss");</code></pre>
|
|
166
|
+
|
|
167
|
+
<p>The registered servlet receives the session and handles the request using the same return values, Promises, status codes, and error handling as other JavaScript Servlets. Achieve also includes registered methods in the appropriate HTTP <code>Allow</code> headers.</p>
|
|
168
|
+
|
|
169
|
+
<p>See the <a href="https://highlevellogic.github.io/achieve/reference/methods.htm">HTTP Methods Reference</a>.</p>
|
|
170
|
+
|
|
171
|
+
### HTTP/1.x CONNECT
|
|
172
|
+
|
|
173
|
+
The independent [achieve-proxy](https://www.npmjs.com/package/achieve-proxy) module adds HTTP CONNECT tunneling with programmable authentication and authorization to Achieve's ready-to-use HTTP or HTTPS server.
|
|
174
|
+
|
|
175
|
+
Beginning with Achieve 3.1.5, `listen()` and `slisten()` return native Node.js server objects without an installed CONNECT listener, allowing `achieve-proxy` or another application-provided handler to attach directly to the server's `connect` event.
|
|
176
|
+
|
|
177
|
+
CONNECT bypasses ordinary Servlet routing and cannot be registered through `registerMethod()`. Neither package requires the other.
|
|
178
|
+
|
|
179
|
+
<h2><a id="server-logging-and-diagnostics" name="server-logging-and-diagnostics"></a>Server logging and diagnostics</h2>
|
|
180
|
+
|
|
181
|
+
<p>Achieve displays startup and configuration information on the console. In development mode, it also provides diagnostic information when managed requests encounter errors. Production mode suppresses these developer-oriented request diagnostics.</p>
|
|
182
|
+
|
|
183
|
+
<p>Persistent server and access logging can be configured independently using <code>setLogging()</code> and <code>setLogPath()</code>. Persistent logging is disabled by default. See the <a href="https://highlevellogic.github.io/achieve/reference/config.htm">Configuration Reference</a>.</p>
|
|
184
|
+
|
|
185
|
+
<h2><a id="live-development-reloading-and-production-mode" name="live-development-reloading-and-production-mode"></a>Live development reloading and production mode</h2>
|
|
186
|
+
|
|
187
|
+
<h3><a id="development" name="development"></a>Development</h3>
|
|
188
|
+
|
|
189
|
+
<p>In the default development mode, Achieve automatically detects changes to directly loaded application modules and reloads them on subsequent requests, without restarting the server. Managed request errors also produce developer-oriented console diagnostics.</p>
|
|
190
|
+
|
|
191
|
+
<h3><a id="production" name="production"></a>Production</h3>
|
|
192
|
+
|
|
193
|
+
<p>Production mode uses stable module caching until restart, eliminating development-only checks for source changes. Routine developer-oriented console diagnostics are also disabled. Persistent server and access logging remain independently configurable.</p>
|
|
194
|
+
|
|
195
|
+
<p>Both modes use the same application design. Mode, caching, compression, input limits, logging, MIME types, routing, methods, and CORS are configuration choices; see the <a href="https://highlevellogic.github.io/achieve/reference/config.htm">Configuration Reference</a>.</p>
|
|
196
|
+
|
|
197
|
+
<h2><a id="testing-and-technical-review" name="testing-and-technical-review"></a>Testing and technical review</h2>
|
|
198
|
+
|
|
199
|
+
<p>Achieve 3 has undergone technical review and automated testing of functional behavior, reliability and error handling, security boundaries, and HTTP standards-related behavior. Regression coverage includes routing, JavaScript Servlets, static resources, conditional requests, compression, byte ranges, and response completion.</p>
|
|
200
|
+
|
|
201
|
+
<p>The automated validation comprises 39 verifier suites. All 39 suites passed on Windows and Ubuntu using the specifically qualified Node.js 24.22.2 runtime. The tests, validation workflows, and CI execution results are publicly available:</p>
|
|
202
|
+
|
|
203
|
+
<ul>
|
|
204
|
+
<li><a href="https://github.com/highlevellogic/achieve/tree/master/tests">Automated test source</a></li>
|
|
205
|
+
<li><a href="https://github.com/highlevellogic/achieve/actions/workflows/test.yml">Cross-platform validation workflow and run history</a></li>
|
|
206
|
+
<li><a href="https://github.com/highlevellogic/achieve/actions/runs/43212174070">Successful Windows and Ubuntu Node.js 24.22.2 validation run</a></li>
|
|
207
|
+
</ul>
|
|
208
|
+
|
|
209
|
+
<p>To repeat the automated checks in a development checkout, run <code>npm run validate</code>.</p>
|
|
210
|
+
|
|
211
|
+
<h2><a id="tutorials-and-reference-documentation" name="tutorials-and-reference-documentation"></a>Tutorials and reference documentation</h2>
|
|
212
|
+
|
|
213
|
+
<p>The <a href="https://highlevellogic.github.io/achieve/index.htm">Achieve v3 documentation</a> is divided into short Getting Started tutorials and focused Reference pages.</p>
|
|
214
|
+
|
|
215
|
+
<h3><a id="getting-started" name="getting-started"></a>Getting Started</h3>
|
|
216
|
+
|
|
217
|
+
<ul>
|
|
218
|
+
<li><a href="https://highlevellogic.github.io/achieve/start/startup.htm">Starting the server</a></li>
|
|
219
|
+
<li><a href="https://highlevellogic.github.io/achieve/start/static.htm">Static content and audio/video</a></li>
|
|
220
|
+
<li><a href="https://highlevellogic.github.io/achieve/start/servlets.htm">Your first servlet</a></li>
|
|
221
|
+
<li><a href="https://highlevellogic.github.io/achieve/start/input.htm">Handling Input</a></li>
|
|
222
|
+
</ul>
|
|
223
|
+
|
|
224
|
+
<h3><a id="reference" name="reference"></a>Reference</h3>
|
|
225
|
+
|
|
226
|
+
<ul>
|
|
227
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/config.htm">Configuration</a></li>
|
|
228
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/routing.htm">Routing</a></li>
|
|
229
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/static.htm">Static Resources</a></li>
|
|
230
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/methods.htm">HTTP Methods</a></li>
|
|
231
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/servlets.htm">JavaScript Servlets</a></li>
|
|
232
|
+
<li><a href="https://highlevellogic.github.io/achieve/reference/session.htm">Servlet Session Object</a></li>
|
|
233
|
+
</ul>
|
|
234
|
+
|
|
235
|
+
<h2><a id="advanced-application-examples" name="advanced-application-examples"></a>Advanced application examples</h2>
|
|
236
|
+
|
|
237
|
+
<p>The <a href="https://highlevellogic.github.io/achieve/index.htm#examples">Achieve Advanced Examples</a> provide a complete, ready-to-run development project for newcomers, students, teachers, and experienced developers. The downloadable ZIP includes installation instructions and examples demonstrating Achieve working with other Node.js packages and services.</p>
|
|
238
|
+
|
|
239
|
+
<p>After extracting the ZIP, open a terminal in <code>achieve_examples</code> and run:</p>
|
|
240
|
+
|
|
241
|
+
<pre><code>npm install
|
|
242
|
+
npm start</code></pre>
|
|
243
|
+
|
|
244
|
+
<p>The project obtains Achieve and its supporting dependencies from npm. Open <a href="http://localhost:8989/">http://localhost:8989/</a> to start exploring, then examine and modify the included applications or use the project as a starting point for your own work. Developers who prefer to create a project from scratch can continue to use the minimal installation and startup examples above.</p>
|
|
245
|
+
|
|
246
|
+
<p>The demonstrations cover integrations and multi-process applications:</p>
|
|
247
|
+
|
|
248
|
+
<ul>
|
|
249
|
+
<li>MySQL</li>
|
|
250
|
+
<li>WebSockets and Rooms</li>
|
|
251
|
+
<li>Cluster</li>
|
|
252
|
+
<li>XML/SAX streaming</li>
|
|
253
|
+
<li>Distributed computing</li>
|
|
254
|
+
<li>SOAP</li>
|
|
255
|
+
</ul>
|
|
256
|
+
|
|
257
|
+
<p>These are demonstrations of Achieve working with other Node.js packages and external services, not additional core Achieve APIs. The included <code>INSTALL.htm</code> opens directly in a browser and provides the specialized startup commands and optional MySQL setup. The maintained source material is in the <a href="https://github.com/highlevellogic/achieve_examples">Achieve examples repository</a>.</p>
|
|
258
|
+
|
|
259
|
+
<h2><a id="community-and-support" name="community-and-support"></a>Community and support</h2>
|
|
260
|
+
|
|
261
|
+
<p>Use <a href="https://github.com/highlevellogic/achieve/discussions">GitHub Discussions</a> for questions, ideas, and general discussion. Report bugs through <a href="https://github.com/highlevellogic/achieve/issues">GitHub Issues</a>.</p>
|
|
262
|
+
|
|
263
|
+
<h2><a id="license" name="license"></a>License</h2>
|
|
264
|
+
|
|
265
|
+
<p>Achieve is released under the MIT License. See the <a href="LICENSE">LICENSE file</a> for the complete terms.</p>
|
|
266
|
+
|
|
267
|
+
<p>Copyright © 2018–2026 Roger F. Gay.</p>
|
|
268
|
+
|
|
269
|
+
<p>Achieve · <a href="https://github.com/highlevellogic/achieve">Source repository</a> · <a href="https://highlevellogic.github.io/achieve/index.htm">Documentation index</a></p>
|