Fix GridTracker API integration by adding comprehensive CORS support#150
Fix GridTracker API integration by adding comprehensive CORS support#150
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: patrickrb <6586559+patrickrb@users.noreply.github.com>
… setup guide Co-authored-by: patrickrb <6586559+patrickrb@users.noreply.github.com>
patrickrb
left a comment
There was a problem hiding this comment.
@copilot getting this build error when it deploys to vercel:
Failed to compile.
./src/app/index.php/api/qso/route.ts
7:10 Error: 'addCorsHeaders' is defined but never used. @typescript-eslint/no-unused-vars
./src/lib/cors.ts
56:40 Error: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
Error: Command "npm run build" exited with 1
Co-authored-by: patrickrb <6586559+patrickrb@users.noreply.github.com>
Fixed both ESLint errors preventing Vercel deployment:
The build now completes successfully with no linting errors. The CORS functionality is now fully implemented with headers included in both successful and error responses, ensuring GridTracker and other amateur radio software can properly access the API. |
Co-authored-by: patrickrb <6586559+patrickrb@users.noreply.github.com>
Fixed the missing CORS headers in PUT and DELETE methods for the /api/cloudlog/qso endpoint. The issue was that while GET and POST requests had proper CORS headers, the PUT and DELETE methods were missing Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds comprehensive CORS (Cross-Origin Resource Sharing) support to enable GridTracker and other third-party amateur radio software to integrate with Nextlog's Cloudlog-compatible API endpoints.
Changes Made
/src/lib/cors.tswith configurable CORS headers optimized for amateur radio software integrationAPI Endpoints Enhanced
/api/cloudlog/*- All Cloudlog-compatible endpoints/index.php/api/qso- SmartSDR and traditional Cloudlog path compatibility/api/cloudlog/qso- QSO management (GET, POST, PUT, DELETE)/api/cloudlog/bands- Amateur radio band information/api/cloudlog/modes- Amateur radio mode informationTechnical Details
The CORS implementation allows:
Access-Control-Allow-Origin: *)Testing
GridTracker users can now configure their software to log QSOs directly to Nextlog using the
/api/cloudlog/qsoendpoint with full cross-origin support.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.