GitHub - janus/static-server

1 min read Original article ↗
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);