Skip to content

Adding custom Http Handlers #600

Answered by lvca
vic0824 asked this question in Q&A
Nov 4, 2022 · 2 comments · 10 replies
Discussion options

You must be logged in to vote

@vic0824 I think that using ArcadeDB's Undertow is an excellent idea! You're right, the easiest way is to create a server plugin (look at MongoDBProtocolPlugin plugin implementation) and then implement the registerAPI method. Example for the HTTP POST API /myapi/test:

@Override
public void registerAPI(HttpServer httpServer, final PathHandler routes) {
routes.addPrefixPath("/myapi",//
  routes.post("/test/{par1}/{par2}", new MyTestAPI(this));
}

At startup, ArcadeDB Server will initiate your plugin and register your API. To start the server with your plugin, register the full class in
arcadedb.server.plugins setting:

Example:

java ... -Darcadedb.server.plugins=MyPlugin:com.yourpackage.MyPl…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@vic0824
Comment options

Answer selected by lvca
Comment options

You must be logged in to vote
9 replies
@lvca
Comment options

lvca Dec 26, 2022
Maintainer

@vic0824
Comment options

@lvca
Comment options

lvca Dec 27, 2022
Maintainer

@vic0824
Comment options

@lvca
Comment options

lvca Dec 27, 2022
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation question Further information is requested
2 participants