lscommand to view them.
--rewritesEnableflag will turn on some basic URL rewriting so we have nice, pretty URLs.
main/indexview. It's located int he
prc.welcomeMessagevariable we set in the controller.
list. The command also created a test case for our handler as well as stubbed-out views for each of the actions.
?fwreinit=1at the end of the URL.
cbmessageboxfrom the CommandBox prompt like this:
cbmessageboxto run. We'll use our new
cbmessageboxmodule in a few minutes. But first, we'll create a simple Model CFC to round out our
GreeterServicein our new app with a
sayHello()method by adding this return statement and save the file.
singletonto the component declaration. This will tell WireBox to only create one instance of our service.
helloWorldhandler we created a while back. Remember, you can hit tab while typing to auto-complete your file names.
cbmessageboxservice into the handler by adding these properties to the top of
variablesscope where we can access it in our action methods.
indexmethod, we'll set the output of our service into an
layouts/Main.cfmand find the
#renderView()#. Add this line right before it to render out the message box that we set in our handler.
helloWorldhandler one final time with
?fwreinit=1in the URL to see it all in action! (Again, your port number will most likely be different.