Description
Modify the codebase to export key components (e.g., the Express app from app.js or a server-start function) so the package can be imported/reused. Make environment variables configurable (e.g., accept options/parameters for MongoDB connection, Auth0 settings, etc., with .env as fallbacks). Ensure ES module compatibility and avoid hardcoding server startup—make it configurable. Update entry points in package.json if needed.
Acceptance Criteria
Code can be imported in a test script without errors; existing server functionality remains intact; env vars can be overridden programmatically (e.g., const app = require('rerum_server_nodejs')({ mongoUrl: 'custom://url' })).
Parallelizable
Done alongside sub-issue 2
Files to Create/Edit
app.js, index.js, possibly new export files.
Description
Modify the codebase to export key components (e.g., the Express app from app.js or a server-start function) so the package can be imported/reused. Make environment variables configurable (e.g., accept options/parameters for MongoDB connection, Auth0 settings, etc., with .env as fallbacks). Ensure ES module compatibility and avoid hardcoding server startup—make it configurable. Update entry points in package.json if needed.
Acceptance Criteria
Code can be imported in a test script without errors; existing server functionality remains intact; env vars can be overridden programmatically (e.g., const app = require('rerum_server_nodejs')({ mongoUrl: 'custom://url' })).
Parallelizable
Done alongside sub-issue 2
Files to Create/Edit
app.js, index.js, possibly new export files.