Origami comics

Serve a site

While developing your static site, you can serve it locally with the Origami server.

site.ori
{
  about: {
    index.html: "<h2>About us</h2>"
  },
  index.html: "<h2>Our site</h2>"
}
http://localhost:5000/about/index.html

About us

You can serve a site defined in standard JavaScript, in the Origami dialect, in a data file, a folder – anything with a tree structure.

site.js
// Standard JS
export default {
  about: {
    "index.html": "<h2>About us</h2>", // Plain text, file buffer, etc.
  },
  // You can also use functions to generate content dynamically
  "index.html": () => `<h2>Our site</h2>`,
};
http://localhost:5000/index.html

Our site

The server follows a URL through that tree to find a resource.

http://localhost:5000/about/index.html

About us

site.ori
{
  about: {
    index.html: "<h2>About us</h2>"
  },
  index.html: "<h2>Our site</h2>"
}
  • This URL path has two keys: about and index.html.
  • Server looks at the site root for about, then inside that for index.html.
  • Server sends resulting resource to browser.

When serving locally, you can view an interactive diagram of your entire site!

http://localhost:5000/!svg
g about/ ->about/ about/ index.html <h2>Our site</h2> ->index.html index.html about/index.html <h2>About us</h2> about/->about/index.html index.html

Read more: Origami serve command

  Comic index