Show HN: A basic static web server

3 months ago 4
const http = require('node:http'); const https = require('node:https'); const fetchStaticPages = require('./static-server/application.js'); // Import the app function from server1.js var heading = "List of static resources:"; // Define a heading for the HTML page const headers = {}; // Your header settings app = fetchStaticPages("echo", heading, headers); // Initialize the app with the static path http.createServer(app).listen(8080);
Read Entire Article