Message from JavaScript discussions

February 2017

— Good question


Server must send ["folder1", "folder2", "etc"] and the client then looks for folder1/index.html and such

— So the node server literally just sends an array and thats it

— Right

— You code it's ok but check the security

— I will use static for sending the html/css and js though

— And fs for getting the name array of a specific hardcoded directory

— Server -> lists contents to client
client -> reads blobs from server using list

— Endgoal is super speedy cms that lazy loads all pages in the background as Blob


#!/usr/bin/env node
var fs = require('fs');
var express = require('express');
var app = express();

app.get('/listPages', function (req, res) {
fs.readdir("pages", function (error, contents) {
if (error) {
throw error;

app.listen(3000, function () {
console.log('Example app listening on port 3000!')


Message permanent page

— I need some help

— I am running into an issue in a function with a default parameter