JabRef-Word-Addin icon indicating copy to clipboard operation
JabRef-Word-Addin copied to clipboard

Connect to JabRef online

Open tobiasdiez opened this issue 4 years ago • 2 comments

Currently, one needs to start JabRef online locally as well for login etc to work. For easier testing, one should use https://jabref-online.herokuapp.com/api instead as a default (with the possibility to easily change it to say localhost:4000/api).

The first problem in doing this, is that jabref online@heroku is not allowing cross-origin requests. @mohit038 could you please try out if adding the following (in this or modified form) to the webpack config works:

devServer: {
    proxy: {
      '/api': 'https://jabref-online.herokuapp.com`,
    },
  },

see https://webpack.js.org/configuration/dev-server/#devserverproxy (I think it would be good to use an environment variable for the server-url that can be provided using an env file, so that it's easy to change this to say localhost). Mohit, please correct me if I'm wrong, but we don't face similar CORS issues in production, since we could then simply host the word addin on the same url has the jabref online api, right?

tobiasdiez avatar Jun 09 '21 21:06 tobiasdiez

Once https://github.com/JabRef/JabRefOnline/issues/217 is implemented, the test server should accept proxy requests while the staging + production server don't.

tobiasdiez avatar Jun 27 '21 08:06 tobiasdiez

This should work now. The test server at https://jabref-dev.azurewebsites.net/ runs against the test data found in https://github.com/JabRef/JabRefOnline/blob/main/prisma/seed.ts and should admit requests from proxies (but not CORS).

tobiasdiez avatar Jul 05 '21 12:07 tobiasdiez