Category Archives: Tricks
Create a static server with node-static
We’ll use node-static to create the instance, first load it from npm:
$ sudo npm install node-static
Create a server.js file in your root path:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var static = require('node-static'); | |
// | |
// Create a node-static server instance to serve the './public' folder | |
// | |
var file = new static.Server('./public'); | |
require('http').createServer(function (request, response) { | |
request.addListener('end', function () { | |
// | |
// Serve files! | |
// | |
file.serve(request, response); | |
}).resume();}).listen(1331); | |
console.log('server started at: http://localhost:1331'); | |
console.log('press ctrl + c to stop server'); |
To activate your static server, run:
$ node server.js
Now you’ll have access to all your static files inside /public folder, for example home.html -> http://localhost:1331/home.html.
Using Apiary.io
Apiary.io is a service to design and test APIs.
“Collaborative design, instant API mock, generated documentation, integrated code samples, debugging and automated testing.”
Seminario de maquetación: avanzado
Seminario de maquetación: básico
git-ftp: working with git in shared servers
git-ftp is an opensource project that uploads via ftp all changes you push in git.
“I use git-ftp for my script based projects, mostly PHP. Most of the low-cost web hosting companies do not provide SSH or git support, but only FTP.”
Testing .kit language
Kit language brings imports and variables to your HMTL layouts, improving your workflow.
Kit is a “language” included in CodeKit that allows you to import parts of HTML and compile the result as .html archives. This is very useful for keep updated your layouts in large and complex structures with several files. Continue reading
Using dropbox as fast frontend publishing system
I recently had to find a system to show quickly and effective front-end work.
In my case i always separe projects into two phases: front-end and back-end. The first one is an adaptation of design to the static layouts, where i develop the structure of the files (fonts, images, css, js), layout, and functionality, etc. Thus while the client reviews this part I can start focus on next phase.
Normally we are used to working with remote servers (often shared servers), and upload the files via FTP or version control (SVN or git) … But sometimes you have to wait until you get the access to the server (from the client or the agency) which makes the work process more tedious.