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

Add support for directory listings in Staticmod #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shym
Copy link

@shym shym commented Nov 29, 2024

The goal of this PR is to implement the "FIXME: staticmod dirs not implemented". The implementation might be too naïve to be included, at least as is. In particular:

  • the generation must load the full directory (so that the entries can be sorted),
  • consequently the generation should probably not be enabled when there are huge directories (which are usually a bad idea anyhow),
  • the listings are unstyled.

The idea was to make it so that

let () =
  let dir = Sys.getcwd () in
  Ocsigen_server.start
    ~ports:[ (`All, 8080) ]
    ~command_pipe:"/tmp/ocsigenserver-cmd" ~datadir:"/tmp" ~logdir:"/tmp" ~debugmode:true
    [
      Ocsigen_server.host
        [ Extendconfiguration.listdirs true; Staticmod.run ~dir () ];
    ]

is a possible ocsigenserver version of python3 -m http.server.

Add a simple generator for directory listings:
- the listings are unstyled
- the generation must load the full directory (so that the entries can
  be sorted)
- consequently the generation should probably not be enabled when there
  are huge directories (which are usually a bad idea anyhow)
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.

1 participant