Preparing programming interface
So… I ‘m moving slowly, because Node.js is new environment for me.
Node.js server is a bad choice for static files. It can’t send files to a client browser, but it opens a file, reads and sends the file’s content to browser. If I have a lot of files — I have a problem, because Node.js will work slowly. Therefore, for Node.js needs Nginx. Nginx proxy needs to start in front of Node.js. After configuration of Nginx proxy in Node.js needs forbid direct access to Node.js server.
app.listen(8000, '127.0.0.1');Now we can’t direct access to Node.js (mysite.lt:8000).
For Node.js html templating I chose a Handlebars engine. I think Jude engine is slower than the Handlebars.
Started Git in SublimeText3 with a Bitbucket repository.
Test tools:
Mocha (npm install — save-dev mocha)
mkdir public/vendor
cp node_modules/mocha/mocha.js public/vendor
cp node_modules/mocha/mocha.css public/vendor
Chai (npm install — save-dev chai)
cp node_modules/chai/chai.js public/vendor
JsHint (npm install -g jshint)
I work in EcmaScript 6, therefore, I created .jshintrc file with this option:
{
“esversion”: 6
}
I installed Gulp, because Grunt is slower and more complicated.
