Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support serving files with default extension #27

Merged
merged 1 commit into from Nov 13, 2012
Merged

Conversation

indexzero
Copy link
Collaborator

Adds ability to serve files with default extension both from the http-server binary and programmatically.

http-server binary

  #
  # A request to /a-file will also try to serve /a-file.html
  #
  http-server /path/to/public -e

  #
  # A request to /a-file will also try to server /a-file.json
  #
  http-server /path/to/public -e json

programmatic usage

  //
  // A request to /a-file will also try to serve /a-file.html
  //  
  var server = require('http-server').createServer({
    root: '/path/to/public',
    ext: true
  });

  //
  // A request to /a-file will also try to serve /a-file.json
  //  
  var server = require('http-server').createServer({
    root: '/path/to/public',
    ext: 'json'
  });

Note: This requires the pull-request on ecstatic to be merged

indexzero added a commit that referenced this pull request Nov 13, 2012
Support serving files with default extension
@indexzero indexzero merged commit f5790a2 into master Nov 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant