allow application run in both command mode and web mode