Skip to content

modulocli: Node.js JavaScript middleware "autogen file route" #17

@michaelpb

Description

@michaelpb

As a user of Modulo to build SSG, I want to be able to do certain backend operations that are normally forbidden by a web server during build-time, such as list files in a directory for auto-detection of images in a gallery, creating a zip file from a particular directory for it to be downloadable, and so on.


Example:

/__dirlisting/path/to/dir.json

Writes a JSON file directory listing of the given /path/to/dir/

/__archive/path/to/dir.zip

Writes a zip file of a listing of the given /path/to/dir/


Feature: Very simple to implement. Basically, extend the modulo express middleware to check if the first part of the path starts with __, and if its a "registered" hook

Then, save the file to the source, and serve immediately


Other implementation:

  • Maybe later, implement a way to move most of it into a backend modulo scripts (much like the modulocli in general)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions