use environment variable to detect server mode