简体   繁体   中英

How OrientDB Studio Code Works?

I have a question regarding the way the OrientDB studio works.

When I build my own web application to access the OrientDB database, I need to enable CORS and then it works, but how comes that the OrientDB studio app works without having to enable CORS?

That's really puzzling me because I'd like to reuse the code logic of the OrientDB Studio app in my own application and it does not work like the OrientDB Studio app.

Also, it seems that the OrientDB Studio app is using the REST API of OrientDB, not the JavaScript API (orientdb-api.js). Am I right?

Is there any documentation I could read to get a full understanding of how the Studio works?

Regards, Jeremie

You need to enable CORS because your app it is outside the domain of ODB. if you are running it in localhost is http://localhost:2480 .

So if you make a request from a different domain the browser stops you if the server has CORS disabled.

Studio starts as a plugin inside ODB http ( http://localhost:2480/studio/index.html ) so is allowed to do request without enabling CORS.

If you do not want to enable CORS you can put your html and js under the www directory in the $ORIENTDB_HOME distribution.

There is no documentation about Studio Code. You can browse it here https://github.com/orientechnologies/orientdb-studio if you need some further information you can ask me as i'm the main maintainer of Studio :D

I can tell you that it does not use the orientdb-api.js as it uses angular.js. I advice you to not use orientdb-api.js but uses directly the REST api with JQuery/Angular.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM