npm run apiYou should see:
🚀 PDF API Server running on http://localhost:3000
📡 Endpoint: POST http://localhost:3000/api/get-pdf-url
💚 Health check: GET http://localhost:3000/health
node test-api-simple.jsOr with curl:
curl http://localhost:3000/healthnode test-api.jsOr with curl:
curl -X POST http://localhost:3000/api/get-pdf-url \
-H 'Content-Type: application/json' \
-d '{"district":"2","taluk":"1","hobli":"1","village":"ALABALA"}'Success:
{
"success": true,
"pdfUrl": "https://landrecords.karnataka.gov.in/service3/FileDownload.aspx?file=..."
}Error:
{
"success": false,
"error": "PDF URL not found. Please check your selections."
}- Check if port 3000 is already in use:
lsof -ti:3000 - Kill existing process:
kill -9 $(lsof -ti:3000) - Then restart:
npm run api
- Check API server logs for errors
- Make sure Puppeteer is installed:
npm list puppeteer - The API uses the same logic as
test_website_flow.py- if that works, API should work too
- Make sure API server is running
- Check firewall settings
- For mobile devices, use computer's IP address (see EXPO_API_SETUP.md)