Skip to content

Instantly share code, notes, and snippets.

@katoy
Created January 26, 2013 07:57
Show Gist options
  • Save katoy/4640902 to your computer and use it in GitHub Desktop.
Save katoy/4640902 to your computer and use it in GitHub Desktop.
Samples using lactate.
actate = require 'lactate'
express = require 'express'
root_dir = __dirname
port = 8080
options = debug: true
app = express()
app.use lactate.static(root_dir)
app.use express.directory(root_dir)
app.listen port
console.log "Listening on port #{port}"
actate = require 'lactate'
express = require 'express'
root_dir = __dirname # process.cwd()
port = 8080
options =
root: root_dir
from: ""
subdirs: true
autoindex: true
bundle: true
cache: true
debug: true
files = lactate.dir(root_dir, options).toMiddleware()
app = express()
app.use files
# app.get('/*', files);
app.listen port
console.log "Listening on port #{port}"
# It is not works for directory-index. Why?
lactate = require 'lactate'
http = require 'http'
port = 8080
# var root_dir = "/Users/youichikato/github/zzz";
root_dir = "./"
options =
root: root_dir
from: ""
subdirs: true
autoindex: true
debug: true
files = lactate.dir(root_dir, options)
server = new http.Server
server.addListener "request", (req, res) ->
files.serve req, res
server.listen port
console.log "Listening on port #{port}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment