This endpoint allows you to check if the microservice is operational. It’s useful for health monitoring and status checks.
API Playground Issue? If you encounter issues with the API playground, you can test directly with cURL or Postman:# Local development
curl http://localhost:3000/api/test
# Alternative local
curl http://localhost:3001/api/test
# Production
curl https://onlyautomator.com/api/test
Response
Indicates whether the service is operational
A message indicating the service status
200 OK
{
"success": true,
"message": "Alive"
}
Example Usage
// Example URLs:
// - Local development: http://localhost:3000/api/test
// - Alternative local: http://localhost:3001/api/test
// - Production: https://onlyautomator.com/api/test
// Example: Check the service status
const checkServiceStatus = async () => {
try {
const baseUrl = 'http://localhost:3000'; // or 'https://onlyautomator.com'
const response = await fetch(`${baseUrl}/api/test`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
if (data.success) {
console.log('Service is operational');
} else {
console.log(`Service unavailable: ${data.message}`);
}
return data.success;
} catch (error) {
console.error('Error checking service status:', error);
return false;
}
};
// Use in a monitoring system
const monitorService = () => {
// Check every 5 minutes
setInterval(async () => {
const isOperational = await checkServiceStatus();
if (!isOperational) {
// Alert administrator
sendAlert('The API service is unavailable!');
}
}, 5 * 60 * 1000);
};
Usage Notes
- This endpoint can be used for service availability checks
- It can be integrated with monitoring systems for service health checks
- No authentication is required for this endpoint