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:
aboutandindex.html. - Server looks at the site root for
about, then inside that forindex.html. - Server sends resulting resource to browser.
When serving locally, you can view an interactive diagram of your entire site!
http://localhost:5000/!svg
Read more: Origami serve command