+1 vote
by
Using laravel with vue installed

It is required to perform the connection using this method -

net.connect(connectionOptions, () => {

When trying to execute, an error comes up

TypeError: net.connect is not a function

This is how the asterisk-ami-client library works, or any other (Nami,
node-asterisk-ami)

I tried using - npm i net -S- but then another error comes up

I read that net.connect should run on the server side, not in the browser

Since I use Laravel with Vue, Laravel itself rebuilds all the scripts and gives them all the same app.js file and any code in Vue will be assembled into one file

How do I call net.coop on the server side in this situation?

1 Answer

0 votes
by
 
Best answer
You have to have a separate service/microservice up, which will be linked to laravel via http or something else. Within one project (laravel + node.js) you can't combine them as two different languages that have to run on the server side. You have a blurred line between js on the server and on the client.
...