Deployment-agnostic server entry point for the WayrApp language learning platform backend.
This module serves as the main deployment entry point, designed for maximum compatibility across
different hosting environments including serverless platforms (Vercel) and traditional server
deployments. It imports the main Express application instance and exports it in a format
suitable for various deployment scenarios.
The module handles essential deployment concerns including module alias registration for compiled
TypeScript code, ensuring proper path resolution in production environments. It provides a clean
separation between application logic (defined in app.ts) and deployment configuration.
Currently configured for serverless deployment on Vercel, where the Express app is exported as
a serverless function handler. The module also includes comprehensive traditional server setup
code (commented out) that provides graceful shutdown handling, health checks, performance
monitoring, and proper error handling for traditional server environments.
Key features include automatic module alias registration for production builds, serverless
function compatibility, traditional server support with graceful shutdown, comprehensive
error handling and logging, health check integration, and performance monitoring capabilities.
The deployment flexibility allows the same codebase to run in multiple environments without
modification, supporting the platform's evolution from serverless to potentially distributed
or traditional server architectures as needed.
Author
Exequiel Trujillo
Since
1.0.0
Example
// Used by Vercel serverless deployment (api/index.js) constapp = require('../dist/server.js').default; module.exports = app;
Example
// Used in development with ts-node-dev // npm run dev -> ts-node-dev src/server.ts
Example
// Traditional server deployment (when uncommented) // node dist/server.js // Provides graceful shutdown, health checks, and monitoring
Deployment-agnostic server entry point for the WayrApp language learning platform backend.
This module serves as the main deployment entry point, designed for maximum compatibility across different hosting environments including serverless platforms (Vercel) and traditional server deployments. It imports the main Express application instance and exports it in a format suitable for various deployment scenarios.
The module handles essential deployment concerns including module alias registration for compiled TypeScript code, ensuring proper path resolution in production environments. It provides a clean separation between application logic (defined in app.ts) and deployment configuration.
Currently configured for serverless deployment on Vercel, where the Express app is exported as a serverless function handler. The module also includes comprehensive traditional server setup code (commented out) that provides graceful shutdown handling, health checks, performance monitoring, and proper error handling for traditional server environments.
Key features include automatic module alias registration for production builds, serverless function compatibility, traditional server support with graceful shutdown, comprehensive error handling and logging, health check integration, and performance monitoring capabilities.
The deployment flexibility allows the same codebase to run in multiple environments without modification, supporting the platform's evolution from serverless to potentially distributed or traditional server architectures as needed.
Author
Exequiel Trujillo
Since
1.0.0
Example
Example
Example