Build router and index of SPA