Hello,
I would like to connect our website to a c program and create a client-server communication.
Can i do it with HTTP-API or should i use another API? I would like to make the connection from the wix website to my server using IP address + port number, and not URL.
You can use IP to connect from your backend to your server. Your backend supports the node.js networking APIs.
I think you should still use HTTP as it makes protocol easy to use, but it is up to you.
I tried to create a js file in the backend but received the following error in the code:
‘require’ is not defined
UPDATE:
have you tried using es6, import * as net from ‘net’; rather than the require method
I don’t think you can import 3rd party libraries e.g npm packages e.t.c in wix code, my suggestions are
-
To have a proxy service with a restful api (e.g. microservice implemented using serverless functions) that receives your commands through wix and communicates with your server, you can also have the service respond to your wix code, with status updates via web-hooks in which case you setup your hooks with the WIX HTTP-API/
-
Have your server communicate directly to Wix as restful API’s, which you implement using the WIX HTTP API