• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tillioss / unrwa-dashboard / 20096848744

10 Dec 2025 11:20AM UTC coverage: 69.444% (-7.1%) from 76.534%
20096848744

push

github

web-flow
Add API system with Appwrite integration and localization support (#1)

- Add /api/scores endpoint for assessment scores with filtering
- Add /api/teacher-surveys endpoint for teacher survey data
- Add /api/translations/{lang} endpoint for language translations
- Add /api/translations endpoint to list supported languages
- Add test endpoints (/api/test/scores, /api/test/teacher-surveys) with sample data
- Update OpenAPI specification with complete API documentation
- Add CORS headers to all API endpoints for third-party integrations
- Create comprehensive API.md documentation
- Update README with API section

145 of 238 branches covered (60.92%)

Branch coverage included in aggregate %.

2 of 60 new or added lines in 7 files covered. (3.33%)

1 existing line in 1 file now uncovered.

355 of 482 relevant lines covered (73.65%)

16.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/src/app/api/openapi/route.ts
1
import { readFileSync } from 'fs';
2✔
2
import { join } from 'path';
2✔
3
import yaml from 'js-yaml';
2✔
4
import { NextResponse } from 'next/server';
2✔
5

6
// CORS headers for third-party integrations
7
const corsHeaders = {
2✔
8
  "Access-Control-Allow-Origin": "*",
9
  "Access-Control-Allow-Methods": "GET, OPTIONS",
10
  "Access-Control-Allow-Headers": "Content-Type",
11
};
12

NEW
13
export async function OPTIONS() {
×
NEW
14
  return NextResponse.json({}, { headers: corsHeaders });
×
15
}
16

17
export async function GET() {
10✔
18
  try {
10✔
19
    const filePath = join(process.cwd(), 'public', 'openapi.yaml');
10✔
20
    const fileContents = readFileSync(filePath, 'utf8');
10✔
21
    const spec = yaml.load(fileContents);
8✔
22
    
23
    return NextResponse.json(spec, { headers: corsHeaders });
6✔
24
  } catch (error) {
25
    console.error('Error loading OpenAPI spec:', error);
4✔
26
    return NextResponse.json(
4✔
27
      { error: 'Failed to load OpenAPI specification' },
28
      { status: 500, headers: corsHeaders }
29
    );
30
  }
31
}
32

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc