Configuring Your Server
Open your project in your IDE. The root of your project should be the same folder in which you started your server.
Our web server has configuration settings ( many of them! ) but that can all be managed by using a special file in the root of the site called server.json. This is a feature of CommandBox although other CLI and web servers probably have their own version.
Since 127.0.0.1:#### can be difficult to remember, let's adapt the server configuration to use an easier to remember address. To do that we will need to run CommandBox as an administrator.
Close CommandBox by either typing exit from the prompt or clicking the X on the window. Re-open CommandBox but this time, do it running as the Administrator. On Windows, right click on the box.exe file and choose Run As Administrator. On a Mac, this might mean opening terminal, navigating to where you unzipped the box application and then typing sudo box . You might need to install your Admin password after doing that.
We need to install another package that is actually for CommandBox itself, not our app specifically. Type install commandbox-hostupdater. Once that installs we are going to make some settings changes.
Think of a domain name that you'll remember like webclass.local or something like that. It can literally be anything. I just use the .local to remind myself that it is on my computer and not on the web. Type server set web.host=webclass.local. Then type server restart. If you get an error, try server restart again. Sometimes the hostupdater needs to navigate some permissions and it errors.
Once the server restarts, type server open to open the browser to the new address. It should say webclass.local:######. We've changed the address in the nav bar, but not the port.
Go back to CommandBox and type server set web.http.port=80 and type server restart then server open after the server restarts. You should see webclass.local in the address bar.