The Ortus BlogBox

"Ortus: A rise, beginning, coming into being, born, the origin!"

 

 

Category Filtering: 'commandbox'

 

CommandBox Embedded Server

Brad Wood
Feb 25, 2015

 

One of the most useful features of CommandBox is the ability to start an ad-hoc server quickly and easily. Any folder on your hard drive can become the web root of a server. To start up the server, cd into a directory containing some CFML code, and run the start command. An available port will be chosen by default and in a few seconds, a browser window will open showing the default document (index.cfm).

CommandBox> cd C:\sites\test
CommandBox> start


To stop the embedded server, run the stop command from the same directory.

CommandBox> stop

OS Integration

You can start as many embedded server instances as you want. Each running server will add a little green "Ortus" icon in your system tray. Right click on it for options:

  • Stop Server
  • Open Browser
  • Open Admin

Full Control

CommandBox's embedded server does not require any prior installations of any CFML engine to work. It does not use Apache, IIS, or Nginx. A very lightweight Java web server called Undertow is used and a context is programmatically deployed via a WAR file.

You should still have all the options you need to set up most local development servers quickly. The web-based administrator is available to you where you can edit any setting, add data sources, CF mappings, and mail servers. To see a list of all the parameters you can pass to the server start command, refer to the CommandBox API Docs or run server start help command directly from the CLI.

CommandBox 3

Developing for CommandBox - When are Errors a Good Thing?

Gavin Pickin
Feb 24, 2015

 

CommandBox is a whole system in itself, and when developing for CommandBox, like you would other applications, debugging is important. By default if you have any errors in your code, CommandBox outputs the error message, and a stack trace to the user in the console… and they will be returned to the prompt. This is great for you as a developer of said command, but its not very user friendly, so how can or should you handle errors in CommandBox.

CommandBox 0

Interactive Shell vs Native OS

Brad Wood
Feb 23, 2015

 

There are two ways to run commands via CommandBox: inside the CommandBox interactive shell, or one-at-a-time commands from your native shell.

Multiple Commands

If you open the interactive shell, you will see the CommandBox splash screen (ASCII art) and then you'll be presented with the CommandBox> prompt. You can enter as many commands as you wish in order and after each command is finished executing, you will be returned to the CommandBox prompt. If you have multiple commands you want to execute manually, this is the fastest method since CommandBox only loads once. This is also the only way to make use of features like tab complete and command history.

CommandBox 2

Running CFML From the Command Line

Luis Majano
Feb 20, 2015

 

One of the features we really wanted to see in CommandBox is OS integration to be able to execute CFML as part of the OS like any other binary.  Me personally, I wanted also to script in CFML instead of convoluted BASH or any type of shell scripting language.  In CommandBox you have several ways of executing via the command line.  Let's investigate a few.

Running CFML Files

You can very easily create ANY cfm file and put any code in it and execute it via CommandBox

CommandBox 0

CommandBox: CFML SandBox

Nathaniel Francis
Feb 18, 2015

 

CommandBox provides a lot of tooling and CLI functionality for CFML developers. But what if you wanted to run or test CFML code beyond the CommandBox REPL? This post explains a simple way that you can setup a genuine CFML SandBox with CommandBox.

CommandBox 0

CommandBox - Commands can be Clean Code Too

Gavin Pickin
Feb 17, 2015

 

In today's world, we use frameworks, and separate concerns with MVC or MV*, we strive for Clean Code to make Uncle Bob proud, or Bossman Bob at least. Just because the “Run” function is all you need in a CFC (which extends the BaseCommand) for CommandBox to index the Command, doesn’t mean you have to jam all your code into that one function. Lets look at some simple code cleanup.

CommandBox 0

CommandBox Snake- All In Good Fun

Brad Wood
Feb 16, 2015

 

As I always say, "All work and no fun makes you a dull programmer!"  Well, with CommandBox, we're here to fight boredom and productivity with the fun "Snake" game.  This is the class game of moving an-ever growing snake around the map in 4 directions while eating up the apples.  For every app the snake devours, it grows by one character in length.

CommandBox 0

Let’s get cooking with CommandBox Recipes!

Luis Majano
Feb 13, 2015

 

One exciting feature about CommandBox is the ability to group commands together into a lovingly little file we call, a recipe.  We even gave it its own extension, .boxr.  This little gem will allow you to automate several commands from your native shell, it will be faster to use our recipe command that allows you to run several CommandBox commands at once. This will allow you to only load the CommandBox engine once for all those commands, but still be dumped back at your native prompt when done. Recipes can also just be useful for a series of commands you run on a regular basis, from test executions, to compressing files, the possibilities are endless.  

Below is a simple example of how to create a recipe and execute it.  For further insight, we recommend you read our chapter on recipes in our CommandBox book.

CommandBox 0

Artifacts Make A Difference

Nathaniel Francis
Feb 11, 2015

 

Let's keep that around

One of the neat "under the hood" features of CommandBox is artifacts. Artifacts are a copy of each package that gets downloaded with CommandBox. This is good for you and for the internet because once you have a package in your artifacts, you don't need to download it again. Artifacts are key to CommandBox efficiency.

We might need that again

The next time you download a package from ForgeBox, CommandBox reads the box.json file for that package's dependencies. Then, it checks to see if we already have a copy of those dependencies in the artifacts. If the dependency is in the artifacts, CommandBox just uses it. If not, then CommandBox calls to ForgeBox to get that dependency. That's efficiency.

CommandBox 0

CommandBox REPL

Curt Gratz
Feb 11, 2015

 

Ever want to try something quick in CFML? Show something off and get the feedback instantly? 

One of the things CommandBox can do for you is provide a REPL (Read-Evaluate-Print-Loop) console for immediate ColdFusion (CFML) interaction so you can do just that.

After CommandBox is installed, just run 

box repl
CommandBox 0
<< 1 ... 3 4 5 6 7 8 9 10 >>