CommandBox comes with a coldbox create app
command that can enable you to create application skeletons using one of our official skeletons or your own:
- Advanced (default) : A tag based advanced template
- AdvancedScript : A script based advanced template
- elixir : A ColdBox Elixir based template
- elixir-bower : A ColdBox Elixir + Bower based template
- elixir-vuejs : A ColdBox Elixir + Vue.js based template
- rest : A RESTFul services template
- Simple : A traditional simple template
- SuperSimple : The bare-bones template
You can find all our template skeletons here: github.com/coldbox-templates
So let's create our first app using the default template skeleton AdvancedScript:
coldbox create app MyApp
This will scaffold the application and also install ColdBox for you. The following folders/files are generated for you:
+coldbox // installed by CommandBox
+config // Application configuration files
+handlers // Your handlers
+includes // static assets
+interceptors // global interceptors
+layouts // Your layouts
+models // Your Models
+modules // CommandBox tracked modules
+modules_app // Custom modules
+tests // Test harness
+views // Your Views
+Application.cfc // Bootstrap
+box.json // CommandBox package descriptor
+index.cfm // Front controller
Now let's start a server so we can see our application running:
server start --rewritesEnable
Note This will start up a Lucee 4.5 open source CFML engine. If you would like an Adobe ColdFusion server then just add to the command:
cfengine=adobe@{version}
where{version}
can be:2016,11,10,9
.
This command will start a server with URL rewrites enabled, open a web browser for you and execute the default event by convention in a ColdBox application: main.index
.
That's it, you have just created your first application.
Tip Type
coldbox create app help
to get help on all the options for creating ColdBox applications.
There will be times when you make configuration or code changes that are not reflected immedidately in the application due to caching. You can tell the framework to reinit or restart the application for you via the URL by leveraging the special URL variable fwreinit
.
http://localhost:{port}/?fwreinit=1
You can also use CommandBox to reinit the application:
coldbox reinit
Tip You can add a password to the reinit procedures for further security, please see the configuration section.