Rename main to index and fix broken platform detection