Skip to content

JavlonMardonov/server-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Checker API

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.

Table of Contents

Endpoints

1. GET /api

Returns a welcome message to confirm the API is running.

Response:

{
  "message": "Welcome to the API server"
}

2. GET /api/checkstatus

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"
}

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/server-checker.git
    cd server-checker
  2. Install dependencies:

    npm install

Usage

To start the server locally for testing:

vercel dev

Access the API at http://localhost:3000/api and http://localhost:3000/api/checkstatus.

Examples

Checking a URL's Status

curl "http://localhost:3000/api/checkstatus?url=example.com"

This documentation should help you understand and use the API effectively. Let me know if you have any questions!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors