Untitled Document
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Javascript SDK in a local environment

  1. #1
    I'm trying to use the ShipRush javascript SDK. I don't know if the problem is because I'm on my local environment, but I'm getting a 404 error when including the script/css using the references posted on your guide. The console error shows that it put my local environment's domain in front, http://visuals.local/static.shiprush.com...

    Code:
    <link href="/static.shiprush.com/ship.app/api/webshipping.integration.client.css" rel='stylesheet' type='text/css' />
    <script src="/static.shiprush.com/ship.app/api/webshipping.integration.client.js"></script>
    If I try it with http or https, I get ERR_NAME_NOT_RESOLVED.

    Code:
    <script src="https://static.shiprush.com/ship.app/api/webshipping.integration.client.js"></script>
    <link href="https://static.shiprush.com/ship.app/api/webshipping.integration.client.css" rel='stylesheet' type='text/css' />
    Last edited by jonesd; 08-09-2019 at 09:56 AM.
    Reply With Quote

  2. #2

    Join Date
    Apr 2004
    Posts
    16,764
    SYSOPS is offline
    Can you tell me how you're trying to use it? If you look at the javascript-interactive-demo.html example, and run it in a browser, does it open ShipRush Web when you click on Open Web Shipping? If not, what error do you get?

    Are there firewall\proxies in between the machine and the outside www world?

    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  3. #3
    I'm using BBL-PRIVATE as the guide.

    I plan to use the SDK to print shipping labels from our web application (LEMP stack). In the above link, I am able to open and interact with the demo. I haven't tried to print the demo label, but everything seems to be working fine on the demo. We don't have any proxies for our network, though we do have a firewall device between our router and internal network.
    Last edited by SYSOPS; 08-09-2019 at 12:28 PM.
    Reply With Quote

  4. #4

    Join Date
    Apr 2004
    Posts
    16,764
    SYSOPS is offline
    OK...so are you embedding this into your own app and it's failing to load? Is your app web based? I guess we need to know more specifics in order to understand the issue you're having.

    Thank you,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  5. #5
    Yes, it is a web app using php. When I said local environment, I'm referring to my personal development environment that I develop and test the app. Does the SDK require https?

  6. #6

    Join Date
    Apr 2004
    Posts
    16,764
    SYSOPS is offline
    Does the SDK require https?
    Yes sir....ShipRush Web is HTTPS and is required

    HTH,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  7. #7
    I see, that is probably the issue then. Is there a way to use the sandbox without https? We'll be on https in production, but development is just http.

  8. #8

    Join Date
    Apr 2004
    Posts
    16,764
    SYSOPS is offline
    It should work as long as you can hit our HTTPS URL. How is your app controlling our access to https?

    Thank you,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  9. #9
    I don't know what you mean by controlling access to https. My development environment is on vagrant homestead. The environment itself is http and works like a normal web server. I'm able to use resources that use https, for example, the google maps API works on my development environment.

    Code:
    <script src="https://maps.google.com/maps/api/js?key={{$apiKey}}&callback=drawSignageMap"</script>

  10. #10
    I tested the references on our stage server, which is on https. I'm getting the same console errors, so the issue must be with the references. In the your guide, your references are shown as:

    Code:
    <link href="/static.shiprush.com/ship.app/api/webshipping.integration.client.css" rel='stylesheet' type='text/css' />
    <script src="/static.shiprush.com/ship.app/api/webshipping.integration.client.js"></script>
    From my understanding a single forward slash expects the files to be on the server. I've been under the assumption that the files are stored on ship rush's server, so I changed it to https://static.shiprush.com. Is that wrong and we're supposed to download the files and store them on our server? If so, I do not see a place to download.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •