node.js – adapter not defined in nodejs webrtc-adapter

I would like to write a webRTC application using nodejs.
I installed webrtc-adapter from npm and it’s there
D:2021projectsWebRTCJanek>npm webrtc-adapter –version

In my app.js I have


app.use('/scripts', express.static(__dirname + '/node_modules/webrtc-adapter/'));

In my index.html I have

When I run ‘node app.js’ I have error

'''ReferenceError: adapter is not defined
    at Object.<anonymous> (D:2021projectsWebRTCJanekapp.js:48:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47'''

I am not able to fix it. Can someone help.


Read more here: Source link