Last active
December 30, 2015 01:39
-
-
Save missinglink/7757339 to your computer and use it in GitHub Desktop.
Absolute minimal node.js static file server using connect.
This file contains hidden or 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
| /** | |
| * Absolute minimal node.js static | |
| * file server using connect. | |
| * | |
| * Directory structure. | |
| * . | |
| * ├── app.js ( this file ) | |
| * └── public/ ( static assets ) | |
| * | |
| * Install & run server. | |
| * | |
| * > npm install connect | |
| * > node app.js | |
| * | |
| * View files | |
| * | |
| * http://localhost:3000/myfile.ext | |
| * | |
| **/ | |
| var connect = require('connect'); | |
| connect.createServer( connect.static( 'public' ) ).listen( 3000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment