Hi,
You can add custom execution paths such as "healthcheck" in your case by following the steps below:
1) Go to http://localhost:4502/system/console/configMgr
2) Search for Apache Sling Servlet/Script Resolver and Error Handler
3) Click on "+" symbol under Execution paths and add your custom execution path. For e.g. /healthcheck/
NOTE: The Execution paths are the paths under which executable scripts will be searched. If a configured value ends with a slash, the whole sub tree is allowed. Without a slash an exact matching script is allowed.
If you hit http://localhost:4502/healthcheck without registering the execution path, you will see the following error:
Error: Requested Path /healthcheck.servlet is not in available search paths
However, though you register the execution path (/healthcheck/) and hit http://localhost:4502/healthcheck , you will still see the following error:
Error: Resource /healthcheck not found
This is because, /healthcheck is a execution search path, where as it is not a resource.
NOTE: sling.servlet.paths are the list of absolute paths under which the servlet is accessible as a resource.
For example, if you register your servlet path in the following way,
"sling.servlet.paths=/healthcheck/healthcheckServlet", it searchs for resource (healthcheckServlet) under execution path (/healthcheck/) and the servlet will be hit as expected without errors.
For more information on how sling servlet works, please refer:
Apache Sling :: Servlets and Scripts
Hope this helps!
Regards,
TechAspect Solutions