Use process.env.PORT for server
Add support for multi-page detection