Answer the question
In order to leave comments, you need to log in
How to write java http local server?
Greetings!
Could you tell me how to write a simple local server that could run local files, for example .bat , on receiving certain requests?
I learned how to set up a local server in java using the om.sun.net.httpserver library, but I just can’t figure out how to make it able to perform certain actions on certain post requests.
At the moment, I already have a server that listens on a specific port on the locale, but my attempts to write logic fail. I would be glad if you at least tell me in which direction to move and where to read
Answer the question
In order to leave comments, you need to log in
Maybe Jenkins is for you. It will be possible to launch both manually through the interface, and through api / hooks
Why explain for God's sake? A bunch of servers and a small cart.
You can write a couple of servlets that, for example, with GET || POST request will launch your batch file.
Here, here about servlets - https://www.baeldung.com/intro-to-servlets
Here, here about running a batch file - https://stackoverflow.com/questions/615948/how-do-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question