• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    JavaScript
  • Created over 12 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Performance-oriented static file server

buffet

Static file server with in-memory cache

Usage

Middleware

Middleware version (compatible with connect, union/flatiron, middler, etc.)

var connect = require('connect')
  , app = connect()
  , buffet = require('buffet')({root: './public'}) // root defaults to ./public

app.use(buffet);
// (non-static routes here)
app.use(buffet.notFound);

var server = require('http').createServer(app);
server.listen(3000, function () {
  console.log('test server running on port 3000');
});

Easy built-in server

$ npm install -g buffet
$ cd /var/www/html && buffet

As a request handler

var server = require('http').createServer();
var buffet = require('buffet')(); // root defaults to ./public

server.on('request', buffet);

server.listen(3000, function () {
  console.log('test server running on port 3000');
});

Options

  • root: Document root. Can also be passed as the first parameter to buffet(). (Default: ./public)
  • indexes: True to look for options.index and serve it for directory requests. (Default: true)
  • index: Name of index file to look for. (Default: index.html)
  • watch: True to auto-update the buffer when files change. (Default: true)
  • notFoundPath: Path to be rendered on buffetMiddleware.notFound. (Default: /404.html)
  • defaultContentType: If the file does not have an extension, set this to specify the default Content-Type sent to the browser. This defaults to application/octet-stream.

Running your own benchmark

Type make bench in the buffet directory (you'll need siege installed).

Brought to you by benchmarx.

See here for my results.


Developed by Terra Eclipse

Terra Eclipse, Inc. is a nationally recognized political technology and strategy firm located in Aptos, CA and Washington, D.C.


License: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

bot18

Bot18 is a high-frequency cryptocurrency trading bot developed by Zenbot creator @carlos8f
HTML
193
star
2

haredis

High-availability redis in Node.js.
JavaScript
154
star
3

node-relations

Entity relationship, role, and permissions API for Node.js
JavaScript
61
star
4

node-upstarter

Easily create upstart services for your node apps
JavaScript
48
star
5

zenbrain

A framework for machine-learning bots
CSS
47
star
6

bundle-deps

easy command to bundle all your node.js dependencies
JavaScript
38
star
7

salty

Alternative public key encryption using NaCl
JavaScript
27
star
8

node-idgen

Minimal ID generator
JavaScript
25
star
9

node-middler

An embeddable middleware runner
JavaScript
22
star
10

node-cli-prompt

A tiny CLI prompter
JavaScript
20
star
11

node-coremidi

Allow Node.js to interact with CoreMIDI services on Mac OS platforms
C++
17
star
12

node-midi-api

An API to simplify MIDI message generation
JavaScript
15
star
13

hydration

Type-accurate serialization of javascript objects
JavaScript
15
star
14

modeler

simple entity system using a functional approach
JavaScript
13
star
15

searching-for-satoshi

i'm looking. where are you?
10
star
16

node-hashcashgen

Simple module implementing the hashcash algorithm
JavaScript
10
star
17

slam

Pure node benchmarker alternative to ab or siege
JavaScript
10
star
18

pemtools

Convert Buffers to/from PEM strings, and read/write SSH/RSA key files. Supports DEK encryption. (Node.js)
JavaScript
8
star
19

saw

actually working file tree watching library
JavaScript
8
star
20

cmmc

Mirror of David Cope's software from Computer Models of Musical Creativity
Common Lisp
8
star
21

node-timebucket

Group timestamps into "buckets" by applying a granularity to a discrete value
JavaScript
7
star
22

engine.oil

Makes running with engine.io a little slicker
JavaScript
7
star
23

that.js

Advanced Node.js framework featuring Evented Evolution Engine, Seamless State Sharing, and Plugin-optimized Operation
JavaScript
6
star
24

s8f.org

My personal website
HTML
5
star
25

node-benchmarx

HTTP-based side-by-side benchmark framework
JavaScript
5
star
26

zenbot_gdax

Zenbot supporting code for GDAX
JavaScript
5
star
27

node-dish

Miniature in-memory http static middleware optimized for serving buffers or strings
JavaScript
5
star
28

gfm-linkify

linkify repository references in github-flavored markdown text, such as sha1, user/repo@sha1, #issue, etc
4
star
29

node-accesslog

Simple common/combined access log middleware
JavaScript
4
star
30

node-tweetbot

Your own markov-chain-based twitter buddy.
JavaScript
4
star
31

ccl-play-soft-midi

Port of Apple PlaySoftMIDI example to Clozure Common Lisp
Common Lisp
4
star
32

motley

highly pluggable, agile http site development framework (Node.js)
JavaScript
4
star
33

lsmidi

Simple command to list midi devices available
JavaScript
3
star
34

metageo

A simple geographic data server using PHP, MongoDB and the GeoJSON spec.
PHP
3
star
35

bladerunner

request router for HTTP or complex async tasks
JavaScript
3
star
36

login-with-github

middleware making it easy to use github as authentication
JavaScript
3
star
37

modeler-redis

redis-powered functional entity system
JavaScript
3
star
38

micro-request

zero-depdency http(s) client
JavaScript
3
star
39

node-addr

Get the remote address of a request, with reverse-proxy support
JavaScript
2
star
40

codeid

A dead simple, random 8-character, universal \"New Unique ID\" string generator, using uppercase letters and numbers that don't look alike. A.K.A., UUIDs FOR HUMANS.
JavaScript
2
star
41

likejagger

2
star
42

dgate

Domain gateway, a simple clustered HTTP virtual host router
JavaScript
2
star
43

arena5

Fork of http://www.kevs3d.co.uk/dev/arena5/
JavaScript
2
star
44

node-tinyauth

Really basic basic authentication middleware
JavaScript
2
star
45

ssh-keygen2

Automate the ssh-keygen command for generating RSA keypairs
JavaScript
2
star
46

node-prog

Prints the source code of a program. Nice screen saver!
JavaScript
1
star
47

socketbench

Benchmarks for web sockets.
JavaScript
1
star
48

salty-gui

web GUI for Salty pubkey crypto
JavaScript
1
star
49

HaikuFox

A Haiku/BeOS style firefox theme originally by Doug Shelton.
1
star
50

sosa_redis

Simple Object Storage Abstraction, redis version
JavaScript
1
star
51

webgram

A web UI for exploring Instagram photos.
JavaScript
1
star
52

world.js

JavaScript
1
star
53

cryptic

easy two-way encryption
JavaScript
1
star
54

sosa_mongo

Simple Object Storage Abstraction, mongo version
JavaScript
1
star
55

socket-game

Multiplayer game demo using sockets.
JavaScript
1
star
56

node-conflation

Helps aggregate subject-predicate-object triples into condensed "digests"
JavaScript
1
star
57

zeropoint

Multiplayer space game.
JavaScript
1
star
58

ytunes

download and convert YouTube videos to mp3
JavaScript
1
star
59

href

middleware providing the current absolute url as req.href
JavaScript
1
star
60

keylogger

capture input from stdin transparently
JavaScript
1
star
61

foilmethod

Band website for FOIL Method.
JavaScript
1
star
62

int-packer

Pack integers into bigger integers
JavaScript
1
star
63

demondays

Plays "Demon Days" by the Gorillaz.
JavaScript
1
star
64

spacemantis

Space multiplayer game in 2.5D.
JavaScript
1
star
65

node-midi-stream

Stream interface for MIDI messages
JavaScript
1
star
66

carlos8f.github.com

JavaScript
1
star
67

idle-miner

Mine bitcoins automatically while your machine is idle
Shell
1
star
68

redis_failover

A Redis automatic failover mechanism
JavaScript
1
star
69

js-test

JavaScript
1
star
70

mus.txt

Text-based music notation using solfeggio
1
star
71

score.js

Text-based musical scoring parser for Node.js
JavaScript
1
star
72

sess

connect/express-style session middleware for apps that don't use connect/express
JavaScript
1
star
73

gistpress

A blog engine built around around gists and github users
JavaScript
1
star
74

node-namegen

Generate random names
JavaScript
1
star
75

modeler-leveldb

leveldb-powered functional entity system
JavaScript
1
star
76

mtgox-orderbook-recorder

Records Mt.Gox order book stream to a CSV file
JavaScript
1
star
77

pempal

Read and write PEM strings, optionally with encryption
JavaScript
1
star
78

node-chat-yardstick

Test scalability of simple chat program using various socket backends
JavaScript
1
star
79

extra

parse extra arguments to a command after "--"
JavaScript
1
star
80

mtgox-synth

Music generation driven by bitcoin trading at Mt.Gox
JavaScript
1
star
81

passport-freedomworks

FreedomWorks authentication strategy for Passport.
JavaScript
1
star
82

mac-synth

Unleash the internal General MIDI synth of your mac
C++
1
star
83

json-stable-stringify

deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results
JavaScript
1
star
84

node-mefirst

Attach an event listener to run first.
JavaScript
1
star
85

botmaker

A dead simple way to make your own Twitter bots.
1
star