Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Create an option to start server with directory listing #6

Closed
nbluis opened this issue Aug 13, 2014 · 5 comments
Closed

Create an option to start server with directory listing #6

nbluis opened this issue Aug 13, 2014 · 5 comments

Comments

@nbluis
Copy link
Owner

nbluis commented Aug 13, 2014

Directory listing (like apache) is a good feature sometimes we have a directory with a lot of files.

When asked for a directory, instead of opening the default file (index.html), list all files and directories within it.

I think a html page to link each entry is a good idea.

PS: Just to be safe, should only be enabled via parameter not by default.

@nbluis nbluis added this to the Version 1.2 milestone Aug 14, 2014
@pconerly
Copy link

pconerly commented Jan 6, 2015

+1 this would be awesome.

@pconerly
Copy link

pconerly commented Jan 6, 2015

If you haven't started on this, would you accept a pull request for it? I might write it out real quick.

@yanickrochon
Copy link
Contributor

If you want to contribute, your PR should include these changes

  1. command-line argument information (ex: -l, --directory-listing), in the file bin/static-server.js
  2. StaticServer constructor options documentation and instance property (ex: this.directoryListing = true;)
  3. Wrap current check in an IF block, checking the option
  4. Implement the function.

Optionally, the renderer could also be a delegated function defaulting to a very basic directory listing renderer. For example :

server.directoryListingRenderer(req, res, file, stat);

This way, when used as a third party module, a function may be given to format the output to a predefined format.

My2cents

@nbluis
Copy link
Owner Author

nbluis commented Jan 20, 2015

Hello @pconerly.

Sorry about the delay, was on vacation in the last days. 😆

It will be great if you want to contribute. If you want to start implementation and ask for feedback before the pulll-request I will be happy to help.

Try to start the implementation using the tests to simplify validation and regression.

The tips above are great @yanickrochon, thank you.

Att;

@nbluis nbluis removed this from the Version 1.3 milestone Mar 15, 2016
@nbluis
Copy link
Owner Author

nbluis commented Jan 24, 2022

Hi guys, thanks a lot for your help.

I decided to retire the project as I no longer have the time to maintain it.

If any of you are interested in making a fork, I'd be happy to mention it for others in the community to use.

More information about this in the README.

@nbluis nbluis closed this as completed Jan 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants