Skip to content

Refactor Code for Module Export and Reusability #57

@joeljoby02

Description

@joeljoby02

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions