HTTP Server Command Handler in a Jar

Today, I’m going to share with you a command handler for the HTTP Server I presented previously.  This is a handler to extend the abilities of that HTTP Server in a Jar to provide you the ability to stop, restart and get status of it, if needed.

WARNING: This is NOT a robust, secure HTTP Server, this is a simple HTTP Server, for when you need one, without the hassle of installing one.  If you need robust, and secure, then go install Apache HTTP, Apache Tomcat or something else!

This provides a rest API to perform a few tasks quickly and easily.  Here are the commands implemented

Path Type Description
/status GET Gets the current status of the HTTP Server, providing back a text based response.
/stop POST Instructs the HTTP Server to shutdown, once all processing is complete.
/restart POST Instructs the HTTP Server to restart once all processing is complete.

These are pretty commands and you easily see how to add additional commands to these as needed.   Stay tuned for my next on this series of posts!

  • Ghostprogrammer
  • I am known for being able to quickly decipher difficult problems to assist development teams in producing a solution. I have been called upon to be the Team Lead for multiple large-scale projects. I have a keen interest in learning new technologies, always ready for a new challenge.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: