This project provides a simple server status checker API, which can validate and fetch data from a specified URL, even when SSL certificates are expired.
Returns a welcome message to confirm the API is running.
Response:
{
"message": "Welcome to the API server"
}Checks the status of a specified URL and handles expired certificates.
Query Parameters:
url(required): The URL to check.
Example Usage:
curl "http://localhost:3000/api/checkstatus?url=api.uzchess.glmv.dev"Successful Response:
{
"url": "https://example.com",
"status": 200,
"statusText": "OK",
"message": "Fetched data successfully with valid certificate"
}Expired Certificate Response:
If the certificate has expired but data is still fetched, the response includes a reason field:
{
"url": "https://example.com",
"status": 200,
"statusText": "OK",
"message": "Fetched data despite expired certificate",
"reason": "Certificate has expired"
}-
Clone the repository:
git clone https://github.com/yourusername/server-checker.git cd server-checker -
Install dependencies:
npm install
To start the server locally for testing:
vercel devAccess the API at http://localhost:3000/api and http://localhost:3000/api/checkstatus.
curl "http://localhost:3000/api/checkstatus?url=example.com"