Skip to main content
Glama
healthcheck.js863 B
#!/usr/bin/env node /** * Docker HEALTHCHECK script * Verifies the server is responding on the /health endpoint */ const http = require('http'); const port = process.env.PORT || 8081; const url = `http://localhost:${port}/health`; http.get(url, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { try { const json = JSON.parse(data); if (json.status === 'ok') { process.exit(0); // Success } else { console.error(`Health check failed: status is ${json.status}`); process.exit(1); // Failure } } catch (error) { console.error(`Health check failed: invalid JSON response`); process.exit(1); // Failure } }); }).on('error', (error) => { console.error(`Health check failed: ${error.message}`); process.exit(1); // Failure });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VeriTeknik/pluggedin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server