Closed nmrgt closed 2 months ago
[!WARNING]
Review failed
The pull request is closed.
The recent changes centralize around the serve
command within the api/justfile
and the run
function in the main TypeScript file. The serve
command now includes conditional logic to handle environment variables, determining whether to run migrations and which port or Redis queue the API will use. The run
function in api/src/main.ts
now requires a mandatory command parameter for booting the app, enhancing control over its initialization process.
File | Change Summary |
---|---|
api/justfile |
Refactored serve command to include environment variable checks for conditional execution of migrations and API server startup on different configurations. |
api/src/main.ts |
Modified run function to remove the default value for command , making it mandatory to provide this value when calling app.boot . |
sequenceDiagram
participant User
participant CLI as Command Line Interface (CLI)
participant Server as API Server
participant DB as Database
participant Redis as Redis Queue
User->>CLI: Run 'serve'
Note over CLI: Check IS_WORKER
CLI-->>CLI: IS_WORKER != true
CLI->>Server: Start API on $PORT
Note over CLI: Check DO_MIGRATIONS
CLI-->>CLI: DO_MIGRATIONS == true
CLI->>DB: Run Migrations
Server-->>User: API Ready on $PORT
alt IS_WORKER == true
CLI->>Redis: Connect to Redis Queue
CLI-->>CLI: Start API Worker
Redis-->>User: Worker Ready
User->>CLI: Initialize with command
CLI->>Server: Run App with command
end
In the realm of code, a change so grand,
Conditional checks, environment planned.
With
serve
refined, on ports we land,Or queue with Redis, migration's hand.
Owls in the night and rabbits in the day,
Code evolves, we guide the way. 🐰
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
serve
command to conditionally run migrations and start the API server based on environment variables.Refactor
command
parameter mandatory in therun
function.