<VirtualHost *:80>
    ServerAdmin webmaster@spaceboard.app
    ServerName spaceboard.app
    ServerAlias www.spaceboard.app
    DocumentRoot /var/www/spaceboard.app/frontend

    <Directory /var/www/spaceboard.app/frontend>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # Proxy API requests to the Node.js backend
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyVia Full

    <Location /api>
        ProxyPass http://localhost:5000/api
        ProxyPassReverse http://localhost:5000/api
    </Location>

    ErrorLog ${APACHE_LOG_DIR}/spaceboard.app-error.log
    CustomLog ${APACHE_LOG_DIR}/spaceboard.app-access.log combined
</VirtualHost>
