Creating and launching "Hello, World!"

Prepare the project

Create a new directory hello containing a file named index.lua, with these contents:

print("Hello, World!")

Launch the application

OS X (Using the Algernon launcher)

  • Start the launcher
  • Select the newly created hello directory as the new server directory
  • Select Start from the menu
  • The browser should open the page that is now being served.

OS X and Linux (using the command line)

Start Algernon with the path to the newly created hello directory as the first argument.

  • algernon ~/algprojects/hello

Replace ~/algprojects/hello with the actual path you chose.

Now open a browser at http://localhost:3000.

Windows (using the Command Prompt)

Start Algernon with the path to the hello directory as the first argument:

  • algernon %UserProfile%\algprojects\hello

Replace %UserProfile%\algprojects\hello with the actual path you chose.

Now open a browser at http://localhost:3000.

Result

You should see Hello, World! in the browser.

Congratulations, you have created and launched your first Algernon application!

Later chapters in this book will not repeat the above steps and will rather show just filenames and contents.