question about staticDirs

General Discussion
  • Plugin & Theme Dev
    #1

    hey, how exactly is the staticDirs within plugin.json implemented?

    Is it somehow possible to add a directory and dynamically add its files later, but as soon as they're available they should be accessible...

  • GNU/Linux
    #2

    That should be how it works right now. The staticDirs property maps an alias (the object key) to the actual system path.

    For example:

    staticDirs: {
        "foo": "bar"
    }
    

    ... will map the route 127.0.0.1:4567/plugins/nodebb-theme-myplugin/foo to /path/to/nodebb/node_modules/nodebb-theme-myplugin/bar

    I believe I used express.static to route the directory, so any files added in after NodeBB has started should still be routed, since the parent directory was the one that was mounted.


Suggested Topics

  • 0 Votes
    4 Posts
    312 Views

  • 0 Votes
    2 Posts
    1288 Views

  • 1 Votes
    3 Posts
    1084 Views

  • 0 Votes
    4 Posts
    1673 Views

  • 0 Votes
    3 Posts
    2381 Views

| | | |