THT is in early Beta. We welcome contributors & feedback.

Get Started  (10 Minutes)

Welcome 

This tutorial will help you set up a THT test app on your local machine.

Requirements:

Step 1: Install THT 

This command will install THT in your user directory.

$ curl -s -o tht.sh https://tht.help/install && source tht.sh

Step 2: Create the App Directory 

You will need to create a new directory for your app, with a Document Root inside of it.

The Document Root directory is for files that can be accessed directly by visitors (e.g. images and css). We will name it public.

(Substitute 'myapp' with a lower-case name for your app.)

$ mkdir -p ~/myapp/public

Step 3: Create a New App 

Go to the Document Root (public), and run tht new.

This will create two folders (data and app) next to your Document Root. These contain a starter app that you can build on.

$ cd ~/myapp/public

$ tht new

Here’s what you’ll see before you confirm:

+-------------------+
|      NEW APP      |
+-------------------+

Your Document Root is:
  /Users/yourname/myapp/public

Is this correct? (y/N)? y

Step 4: Load the Starter App 

While you are still inside your Document Root, run this command to start the local test server:

$ tht server

Here’s what you’ll see:

+-------------------+
|    TEST SERVER    |
+-------------------+

App directory:
  /Users/yourname/myapp

Serving app at:
  http://localhost:8888

Press [Ctrl-C] to stop.

NoteThe built-in test server is great for development, but you will need to use a full web server, like Apache, to host the final app.

Great! 

Now load this URL in your web browser: http://localhost:8888

Here’s what you should see:

Hello World

Congratulations! The hard part is over.