Skip to content

Implement Basic Express Server Setup with Configurable Port#9

Open
Merango wants to merge 7 commits intosouravg77:ac1b4def-e6b6-46ff-b94c-6aa773429112from
Merango:express-server-basic-setup-1749670882
Open

Implement Basic Express Server Setup with Configurable Port#9
Merango wants to merge 7 commits intosouravg77:ac1b4def-e6b6-46ff-b94c-6aa773429112from
Merango:express-server-basic-setup-1749670882

Conversation

@Merango
Copy link
Copy Markdown

@Merango Merango commented Jun 11, 2025

Implement Basic Express Server Setup with Configurable Port

Description

Task

Implement basic Express server setup

Acceptance Criteria

  • Server can be created with a configurable port
  • Default port is 3000 if not specified
  • Environment variable PORT is respected
  • Health check endpoint is available
  • Server can be run directly or imported

Summary of Work

Express Server Implementation

Changes Made

  • Created a modular Express server setup in src/server.ts
  • Implemented a flexible createServer function that:
    • Accepts an optional port number (defaults to 3000)
    • Creates an Express application instance
    • Adds a basic health check endpoint /health
    • Configures server listening with logging
  • Added environment variable support for port configuration
  • Ensured the server can be both run directly and imported as a module

Implementation Details

  • Used TypeScript for type safety
  • Created a factory function createServer() for server instantiation
  • Implemented conditional server startup to support different usage scenarios
  • Added a health check endpoint for basic server status verification
  • Supported port configuration via environment variable or default

Testing Approach

  • Verified server creation with default and custom ports
  • Confirmed health check endpoint functionality
  • Ensured flexible module usage (direct run and import)

Notes

  • Server logging provides basic startup information
  • Modular design allows for easy extension and testing

Changes Made

  • Created src/server.ts with modular server creation function
  • Added environment variable support for port configuration
  • Implemented health check endpoint
  • Added conditional server startup logic

Tests

  • Verify server can be created with default port
  • Verify server can be created with custom port
  • Check health check endpoint returns 200 status
  • Confirm environment variable PORT is respected

Signatures

Staking Key

84mPEB3qLaB2KQr1RXxNgYDF5DSv5ZyuDPpb9qeeNyyT: kvZFM8UvBjQkEeHjanfJcVPpsvAKtAdPznAGMdy428XpaxQiRpTTENbAANpLXaKyAhtGy1hYhUts3xSs7vKUR1wWjARQU9jirAoX5nJ84fqBKuJAbYtvhU55ELkmV4P9dcoKzwJmGZHzJGyKXDRsintdpsMAQDSieUZ1G3wTe2Y9QE8bSMmCFFD8we59AVBDnvb2WKXuUwEhdMafVbWZH2uPfDMXRHVLTz6G7x33rczdRVnVoyCJDV31FkPR3vbfxmAmbVUxKKBPGbgt1TM6zfxnuXKKvSHWmTeb2qpUtKCxBjciamQ7JQBDXgFwgFZA3ExQyjVG4aM1XQsBU8dZd6haKBqHisvtZCw9QzWhyGZsFjMQB85AxPfjYZ4FX9R9QDCUhJbtwkbfamFCW5N3A2rMj8Y1jWt

Public Key

FLcUWedFSfvYeGjtnoXqgNtvtqEBCKwUK7Qn48hGnwsk: 9n7rTHALdAsEJJq4JS38SpHdthU2y3M5iFatszJxXUawomUwa1kcpg9L622fHBJHRLTdZAA18jHkdofTCknDpdQqirbPtiybrdRKYnSPvZCpMWjA6zxyBrTn56gjeAbNQdLS8a1psqJKR1hBBdYkqmvNmLoDMFLh15RMgP5ho1PQsBCTUuBHGLNcsrQkQ7YdsN25CHFUnJgVDj1cCqvUAZc8b8dLkMnYs1kg7Kv8TTUuCcYt7Y8kmSpasqQkiHR8fq2nknGsiXAUQuTa3ewNhekCSzf9jVCpracxJR1iSJk4sXG7EF3rN9TkpXSrdfyr8ourzVUaDxT4VTAQ9N55PgwyBiauP9xMq6kH3siQzVveaNEpAJmpja74v2kQLJCDH8iNPx6HtNiVM6PrXPEQjTThq1i8Ki4

@Merango Merango changed the title [WIP] Implement Basic Express Server Setup Implement Basic Express Server Setup with Configurable Port Jun 11, 2025
@Merango Merango marked this pull request as ready for review June 11, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant