Nara – Alt-j
Build a shoppping cart with MarionetteJS (1)
Rachel’s Song – Vangelis
I Feel the Earth Move – Martika
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.