Skip to content

feat: make ROOT_FOLDER_ID configurable via env #26

@mfscpayload-690

Description

@mfscpayload-690

Summary

Make Google Drive root folder selection configurable via environment variable instead of hardcoding it in code.

Problem

ROOT_FOLDER_ID is currently hardcoded in netlify/functions/api.js.
This makes environment-specific deployments harder and requires code changes + redeploys for folder updates.

Proposed Change

  • Read root folder ID from env var:
    • ROOT_FOLDER_ID
  • Keep a backward-compatible fallback to current hardcoded ID (optional, for transition).
  • Return a clear startup/runtime error if ROOT_FOLDER_ID is missing and no fallback is allowed.
  • Document the variable in:
    • .env.example
    • README.md

Acceptance Criteria

  • API uses process.env.ROOT_FOLDER_ID for /api/folders.
  • .env.example includes ROOT_FOLDER_ID=... with description.
  • README setup section includes this variable.
  • App works in local + Netlify when ROOT_FOLDER_ID is configured.
  • No behavior regression for existing endpoints (/api/folders, /api/files/:folderId, /api/search).

Out of Scope

  • Changing Drive API query logic beyond root folder source.
  • Adding user-level auth or per-user folder routing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions