logux / server

Build your own Logux server or make a proxy between a WebSocket and an HTTP backend in any language

Home Page:https://logux.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Server#autoloadModules

ai opened this issue · comments

This method should be in Server, not BaseServer. It should:

  1. Take this.options.root and load all modules/* files.
  2. Each module will have server => void signature.

I think it's worth considering next.js filesystem-based routing experience, something like

.
|-- actions
|   `-- users
|       |-- add.js
|       `-- rename.js
`-- channels
    `-- users
        `-- [id].js

Maybe not in the core API though

This issue already fixed in next branch with an option to override pattern.