Currently, I am utilizing next.js 9.5.x and am in search of a method to set up the hostname and port via the next.config.js file. Despite consulting the documentation, I have yet to discover a solution to this issue.
Previously, I leveraged a series of .env files within the next.config.js file to configure various aspects and pass environment variables to the application code directly. Within these environment variables, I have already defined the hostname and port values, which I aim to reuse for server/development server setup.
Thus far, only two options have presented themselves for adjusting these parameters - using next command line settings or implementing a custom server.js file. Currently, I rely on a custom server.js, where I must once again read all .env files to establish the port and hostname settings.
My goal is to eliminate the need for the server.js by configuring everything through the next.config.js file where all necessary information already resides.
I would greatly appreciate any guidance or insights on this matter. Thank you.