1

I am trying to develop a word addin. It will provide corrections for a word based on the context. The language will be Bengali.

My idea is that there will be a python server in localhost. Yes it will run on the localhost. Otherwise if it is a central server there will be too much requests. So somehow (maybe through an exe file I will run the server on in localhost) I will make the server run on localhost. The .exe file can be distributed to anyone and when he/she runs it, it will run on their localhost and then he/she can use the word addin (that I am developing) to call to the localhost to get the desired output. It should be noted that, the platform will be windows.

But the problem is word JavaScript api doesn't let me call to the localhost in http. It only can call to https. But localhost isn't https. If there's anyway I can call the word api in http localhost? Also, as I am looking to make a complete product, I am trying to skip OS related configurations. For example, making localhost certified. Because, when the application (python server) will be transferred, I don''t know how and if it is possible to run script in others' windows OS and make their localhost certified. So, it will be very helpful to make word api just call to my localhost using http (or atmost https://localhost) and not some https://somedomainname.com.

For coding environment to develop the word addin, I am using script lab. So, it will be better to find a solution that will be supported by script lab.

1 Answers1

0

There are a few problems with this approach.

For one - you will never pass the validation, when you're trying to call the localhost - since it will fail by default and you'll be asking the users to install an additional software to support your JS add-in. The add-ins should work standalone.

If there's anyway I can call the word api in http localhost?

No - there isn't in this context. Your final manifest URL's need to be https and they should be externally available.

I am trying to skip OS related configurations. For example, making localhost certified. Because, when the application (python server) will be transferred, I don''t know how and if it is possible to run script in others' windows OS and make their localhost certified.

One of the benefits of the Office store is that Microsoft can look after if the add-in the customers are installing (which we're developing) is malicious or not. Trying to say you want to bypass validation doesn't help this case.

My idea is that there will be a python server in localhost. Yes it will run on the localhost. Otherwise if it is a central server there will be too much requests.

It should be a central server and you should handle the scalability aspect of it. You might not have a huge number of users as you're imagining to begin with. I'd recommend Heroku - they support python and their first tier is free, you can develop & publish your add-in and once it starts getting significant traffic, you can look into moving it to other places.

Mavi Domates
  • 4,262
  • 2
  • 26
  • 45
  • Thanks for the feedback. In python, I was able to make my localhost https using runserver_plus. Yet I am failing to call it from my word API using jQuery. I tried both in Script Lab and Visual Studio 2017 Community edition. I updated the manifest for Visual Studio 2017 in appDomain and made it https://localhost:3000 but still it is getting network error. For now, I am not thinking about bypassing the validation. So can you say why it is not working? Even for testing purposes? – Tahmid Khan Jun 07 '19 at 04:38
  • Also, MS Word corrects or gives synonyms of words offline, right? So, how can I make my add-in work offline? That's why my idea was like that (using server in localhost). So, any idea on that if it is possible? – Tahmid Khan Jun 07 '19 at 08:44
  • To your second point - at the moment that's not possible. In theory a user can open your add-in right before they board a plane and keep on using it on the plane, on the condition that your add-in doesn't have any server side logic. This would most likely fail though because once the browser can't connect it'll likely throw some sort of error. For your first case it depends how are you testing it. Are you using a client or the web experience? – Mavi Domates Jun 07 '19 at 15:31
  • *This would most likely fail though because once the browser can't connect it'll likely throw some sort of error.* - Why the browser can't connect? Everything is in localhost but different ports. And for testing, there is a django server in localhost running on port 3000 and i guess word api is running on port 44343. I think it is a client experience (not surely got the question). – Tahmid Khan Jun 08 '19 at 17:05