Kitten

Make your first static ā€œHello, world!ā€ Kitten page using plain old HTML.

Topics covered

Let’s quickly create and test your first ā€œHello, world!ā€ Kitten site.

  1. Create a directory for the example and enter it:

    mkdir kitten-playground
    cd kitten-playground
    
  2. In a separate terminal pane, tab, or window, run Kitten in the same folder:

    kitten
    

    When you run kitten without any arguments, it defaults to serving the current directory. You can also specify a path as the first argument (kitten [path to serve]) to serve a different directory than the one you’re currently in.

  3. Now hit https://localhost in your browser and notice that Kitten gives you a 404: Page not found. error.

    This makes sense as we haven’t created any pages yet. Keep an eye on your browser as we fix that in the next step.

  4. Create a file called index.html, add the following content to it, and save it:

    <h1>Kitten</h1>
    <p>šŸ±ļø</p>
    

    Notice that when you save it, the page in the browser automatically reloads with your content (this is known as ā€œhot reloadā€ and it helps you preview the results of your edits in near realtime while making Kitten apps).

    Screenshot of web page with a heading (Kitten) and an emoji of a kitten.
    Look, it’s a Kitten!

So we’ve seen how Kitten happily serves any HTML you throw at it just like any good web server should.

But you can render HTML using any old web server…

Let’s start doing things no other web server can do, shall we?

Next tutorial: Dynamic Pages

Like this? Fund us!

Small Technology Foundation is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.