rearrange server/index.js