I'm new to node.js I want to create a simple static.js static file server, but I have some problems. I have installed express.js 4.2 everywhere:
npm install -g express-generator
I have this code in httpsrv.js:
var http = require('http'); var express = require('express'); var app = express(); app.use('/', express.static(__dirname + '/public')); app.listen(3000, function() { console.log('listening')});
I'm not sure that everything is in order. I think this is not enough, but I can not start it with an error: I can not find the express module.
I want to create a simple HTTP server that can work from a specific folder ("\ public", for example), and I use the language .html. I found a lot of nonsense on the Internet, I do not want to use this .Jade thing, and I do not want to create empty web applications using express, etc. I want an express.js http server that can work like Apache, and can put html pages from the specified folder first. Can someone help me with this, suggest a good article that explains step by step because I am starting.
Zsoca
source share