Skip to content

Fix Backend main.ts Bootstrap and CORS Configuration #210

@Jeffrey0522

Description

@Jeffrey0522

Fix Backend Bootstrap and Architecture Issues

  • Name / Title: Fix Backend main.ts Bootstrap and CORS Configuration
  • Complexity: Low
  • Task Type: Backend / Bug
  • Description: The NestJS application currently has critical bugs in its entry file (src/main.ts) that prevent it from compiling and communicating with the frontend. AppModule is used in NestFactory.create() but never imported. Furthermore, Cross-Origin Resource Sharing (CORS) is not enabled, which will block all API requests from the Next.js frontend during local development and in production.
  • Technical Requirement: NestJS, TypeScript
  • Estimated time to deliver: 1 hour
  • Acceptance criteria:
    • src/main.ts compiles successfully without missing import errors.
    • CORS is explicitly enabled in main.ts with appropriate origins configured (or open for local dev).
  • MUST DOs:
    • Add import { AppModule } from './app.module'; to main.ts.
    • Add app.enableCors() with credentials support if using cookies for JWT, or standard headers if using Authorization headers.
  • References:
    • Repo: skillcert-backend-server
    • Files: src/main.ts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions