munshkr / flok

Web-based P2P collaborative editor for live coding sounds and images
https://flok.cc
GNU General Public License v3.0
261 stars 39 forks source link

flok-web parameter --static-dir not working #172

Closed crcdng closed 10 months ago

crcdng commented 1 year ago

to reproduce

npm install -g flok-repl flok-web

flok-web --static-dir <some-dir>

throws an error.

ReferenceError: app is not defined
    at startServer (file:///Users/<username>/.nvm/versions/node/v19.5.0/lib/node_modules/flok-web/server.js:18:7)

After patching Users/<username>/.nvm/versions/node/v19.5.0/lib/node_modules/flok-web/server.js with the missing line const app = express(); the error is gone but serving from the directory still doesn't work. Serving from the default location (/Users/<username>/.nvm/versions/node/v19.5.0/lib/node_modules/flok-web/dist) works.

To verify, put different images into the default location and the additional location and test with hydra:

s0.initImage("http://localhost:3000/<myimage1>.png")
s1.initImage("http://localhost:3000/<myimage2>.png")
osc(6).modulate(src(s0),1).out(o0)
osc(6).modulate(src(s1),1).out(o1)
render()

MacOS, node v19.5.0

munshkr commented 10 months ago

Hey! Sorry for not responding earlier. I know it's been a long time, but I fixed a couple of things in the server last week. Feel free to reopen if this is still an issue.