N
N
nicolaa2020-10-14 06:29:50
Node.js
nicolaa, 2020-10-14 06:29:50

How to use nodejs script on server with laravel?

I use laravel with vue installed.

It is required to connect using this method -

net.connect(connectionOptions, () => {

When trying to execute, an error occurs

TypeError: net.connect is not a function This is how the asterisk-ami-client

library works , or any other (Nami, node-asterisk-ami) Tried to use - npm i net -S - but another error comes up I'm using Laravel with Vue - Laravel itself rebuilds all scripts and gives them all one app.js file and any code located in Vue will be compiled into 1 file How to call net.connect in this situation






on the server side?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Darkhan Kamaliev, 2020-10-14
@nicolaa

You must have a separate service\microservice that will be connected to laravel via http\or something else. Within the framework of one project (laravel + node.js), you will not be able to combine them as 2 different PLs, which should be running on the server side. Your js line is blurred on the server and on the client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question