set up main js file and global object, and router