Skip to content

Make HTTP port and CORS origin environment-configurable #29

@CryptoJones

Description

@CryptoJones

Problem

server.js hardcodes two production-blocking values:

  • Listen port 80 — requires root or a setcap to run, blocking npm start for non-privileged users and most containers.
  • CORS origin http://localhost:4200 — unusable in any real deployment without editing the file.

Scope

  • Read the listen port from process.env.PORT with a sensible default (e.g., 3000).
  • Read the CORS origin from process.env.CORS_ORIGIN, accepting a single origin or a comma-separated list. Document a safe default.
  • Add an Environment Variables section to README.md and ship a .env.example.

Acceptance criteria

  • PORT=3000 npm start works for a non-root user.
  • CORS_ORIGIN=https://example.com node server.js enforces that origin only.
  • README has an Environment Variables table.
  • .env.example is committed with placeholder values.

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/1654/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions