Page 1 of 1

OnlyOffice | Document server | Angular integration issue

Posted: Wed Mar 06, 2019 10:39 am
by vicky25vishal
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.

Re: OnlyOffice | Document server | Angular integration issue

Posted: Wed Mar 06, 2019 11:34 am
by Maxim
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

Re: OnlyOffice | Document server | Angular integration issue

Posted: Wed Mar 06, 2019 2:13 pm
by vicky25vishal
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.

Re: OnlyOffice | Document server | Angular integration issue

Posted: Wed Jul 24, 2019 5:59 am
by sumesh.tc@gmail.com
How can i integrate only office document editor in my angular app

Re: OnlyOffice | Document server | Angular integration issue

Posted: Thu Jul 25, 2019 8:22 am
by Maxim
Hello sumesh.tc@gmail.com!
Please visit our API for the Onlyoffice Document Server

Re: OnlyOffice | Document server | Angular integration issue

Posted: Fri Jul 26, 2019 10:20 am
by sumesh.tc@gmail.com
I have tried these bu not getting any examples .

Re: OnlyOffice | Document server | Angular integration issue

Posted: Wed Jul 31, 2019 7:26 am
by uwohlfeil
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

Re: OnlyOffice | Document server | Angular integration issue

Posted: Wed Aug 07, 2019 7:12 am
by sumesh.tc@gmail.com
Thanks for your time ...