achieve
v2.2.0
Published
A modern high-performance, developer-friendly web server.
Downloads
86
Maintainers
Readme
server.setAppPath("c:/myachieve/myapps"); // set base directory for all applications server.setRootDir('root'); // set a subdirectory under the root directory for THE ROOT application server.setCaching(true); // turn browser caching support on server.setCompress(true); // compress static resources server.showMimeTypes(); // Show the current list of supported MIME Types server.addMimeType("pub","application/x-mspublisher"); // add an unsupported MIME type server.addAVMimeType("wav","audio/wav"); // add an unsupported AV MIME type server.setNodeEnv("development"); // set Node environment
server.listen(8989); // listens on port 8989
// in myservlet.js exports.servlet = function (session) { var other = session.load("otherfile.js"); // Extends servlet features to otherfile; reloads if cache is stale. return other.hello(); }
const options = { // An easy way to acquire free certificates is explained below. key: fs.readFileSync('C:/certs/private.key'), // For certificate files that have been placed in C:/certs/ ca: fs.readFileSync('C:/certs/bundle.crt'), // optional, provides "full chain" of certificates cert: fs.readFileSync('C:/certs/certificate.crt') }; server.slisten(options);