Message from JavaScript talks

February 2017

— Hii friends

— 

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

app.get('/client.js', function (req, res) {
fs.readFile("client.js", function (error, data) {
if (error) {
throw error;
}
res.send(data);
});
});
app.get('/pages', function (req, res) {
fs.readdir("pages", function (error, contents) {
if (error) {
throw error;
}
res.send(contents);
});
});

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

— Literally all it will do

— I am making a tiny js CMS that runs on the browser, all the server does is give it a list of page names

Message permanent page

— Dont use fs

— Its very danger

— Oh?

— How so?

— Use send static

— I am looking for code, notification for Mobile and desktop please any one help me my site is total responsive site

Message permanent page

— Https://expressjs.com/en/starter/static-files.html

— Thanks oh and I am already using express so thats a plus