codeproject / CodeProject.AI-Server

CodeProject.AI Server is a self contained service that software developers can include in, and distribute with, their applications in order to augment their apps with the power of AI.
Other
574 stars 136 forks source link

apiServiceUrl issue #20

Closed Major2000 closed 1 year ago

Major2000 commented 1 year ago

Area of Concern

Description when I deployed the AI server to okteto cloud platform, the end-point is https://..... this causes server not to be fount by the client when I review the code I found this javascript in Visio.html

    <script type="text/javascript">

        const useSVG            = true;
        const pingFrequency     = 1000; // milliseconds
                const apiServiceUrl     = "http://" + (window.location.hostname || "localhost")
                                + ":" + (window.location.port || 32168);
        const serviceTimeoutSec = 20;
        let serverOnline        = false;
               ...
      </script>

The variable apiServiceUrl has got the format http:// and appends the link there. I hope it refers to Localhost links only What about other scenarios like when the server is deployed to remote cloud??

Expected behavior The apiServerUrl shouldn't be only local host Url other means should also be possible

Screenshots Screenshot 2022-10-01 174206

System

ChrisMaunder commented 1 year ago

The initial URL that's set has been corrected to include protocol

const apiServiceUrl = (window.location.protocol || "http:") + "//"
                    + (window.location.hostname || "localhost")
                    + ":" + (window.location.port || 32168);

However, regardless of the initial setting, you can update it to whatever URL you have your CodeProject.AI Server installed on just by editing the value in that URL text box

Major2000 commented 1 year ago

Thanks