Search Results

Mojito Quickstart


System: Unix-based system.

Software: Node.js (>= 0.8.0 <0.11), npm (> 1.0.0)

Installation Steps

  1. Globally install the Mojito CLI package (mojito-cli) from the npm registry so that you can run Mojito commands. You may need to use sudo if you run into permission errors.

    $ npm install mojito-cli -g

  2. Confirm that Mojito has been installed by running the help command.

    $ mojito help

Create a Mojito Application

  1. $ mojito create app hello_world
  2. $ cd hello_world
  3. $ mojito create mojit myMojit

Modify Your Application

To make the application return a string we want, replace the code in mojits/myMojit/controller.server.js with the following:

YUI.add('myMojit', function(Y, NAME) {

  Y.namespace('mojito.controllers')[NAME] = {

      index: function(ac) {
          ac.done('Hello, world. I have created my first Mojito app at ' + (new Date()) + '.');


Running the Application

  1. From the hello_world application directory, start Mojito:

    $ mojito start

  2. Go to http://localhost:8666/@myMojit/index to see your application.

  3. Stop your application by pressing Ctrl-C.

For a more in-depth tutorial, please see Tutorial: Creating Your First Application. To learn more about Mojito, see the Mojito Documentation.