OnlyOffice | Document server | Angular integration issue

Suggestions on Document Server Installation/Functionality
Post Reply
vicky25vishal
Posts: 3
Joined: Mon Feb 25, 2019 2:31 pm

OnlyOffice | Document server | Angular integration issue

Post by vicky25vishal » Wed Mar 06, 2019 10:39 am

I am trying to load OnlyOffice editor using Angular 6, But my angular app and document server are on different machines. so when angular app tries to load api.js to load editor its showing CORS issue while loading api.js.
I have attached browser response and console log which expecting 'Access-Control-Allow-Origin' header in response.PFA for screen shots.
Please help me to resolve this issue.
Attachments
onlyoffice2.PNG
onlyoffice2.PNG (51.62 KiB) Viewed 458 times
onlyoffice1.PNG
onlyoffice1.PNG (19.41 KiB) Viewed 458 times

Maxim
Posts: 2017
Joined: Tue Oct 11, 2016 2:34 pm

Re: OnlyOffice | Document server | Angular integration issue

Post by Maxim » Wed Mar 06, 2019 11:34 am

Hello!
What instruction you followed to install Document Server?
Try to add header into /etc/nginx/includes/ onlyoffice-http.conf

Code: Select all

add_header 'Access-Control-Allow-Origin' 'localhost:4202';
or

Code: Select all

add_header 'Access-Control-Allow-Origin' 'http://localhost:4202';
and restart Document server

vicky25vishal
Posts: 3
Joined: Mon Feb 25, 2019 2:31 pm

Re: OnlyOffice | Document server | Angular integration issue

Post by vicky25vishal » Wed Mar 06, 2019 2:13 pm

Hi Maxim,

I have followed below steps to install it on my system as i am creating POC on it.Its deployed on windows machine.
https://helpcenter.onlyoffice.com/serve ... -apps.aspx

Thanks for the help. The solution you provided it worked for me.

sumesh.tc@gmail.com
Posts: 3
Joined: Tue Jul 23, 2019 9:31 am

Re: OnlyOffice | Document server | Angular integration issue

Post by sumesh.tc@gmail.com » Wed Jul 24, 2019 5:59 am

How can i integrate only office document editor in my angular app

Maxim
Posts: 2017
Joined: Tue Oct 11, 2016 2:34 pm

Re: OnlyOffice | Document server | Angular integration issue

Post by Maxim » Thu Jul 25, 2019 8:22 am

Hello sumesh.tc@gmail.com!
Please visit our API for the Onlyoffice Document Server

sumesh.tc@gmail.com
Posts: 3
Joined: Tue Jul 23, 2019 9:31 am

Re: OnlyOffice | Document server | Angular integration issue

Post by sumesh.tc@gmail.com » Fri Jul 26, 2019 10:20 am

I have tried these bu not getting any examples .

uwohlfeil
Posts: 5
Joined: Mon Apr 29, 2019 8:53 am

Re: OnlyOffice | Document server | Angular integration issue

Post by uwohlfeil » Wed Jul 31, 2019 7:26 am

Hi sumesh.tc@gmail.com,

I also use OnlyOffice in an Angular 6 application. The angular app and the onlyoffice instance are on a different domains.
By angular backend is a spring boot microservice (java).

Your application have to allow your browser to load cross domain code.
https://developer.mozilla.org/en-US/doc ... low-Origin

In Spring boot for example:
protected void configure(HttpSecurity http) throws Exception {
// ...
http.cors();
http.csrf().disable();
// ...
}

Best Regards
Ulrich Wohlfeil

sumesh.tc@gmail.com
Posts: 3
Joined: Tue Jul 23, 2019 9:31 am

Re: OnlyOffice | Document server | Angular integration issue

Post by sumesh.tc@gmail.com » Wed Aug 07, 2019 7:12 am

Thanks for your time ...

Post Reply