Assets

The tutorial app works, but needs some styles and scripts. This page shows you how to load static assets.

Serve static assets

Make sure your static/ directory exists. By default, LiteNode serves from a folder named static at the project root — no configuration needed:

static/
├── css
│   └── app.css
└── js
    └── app.js

Load the stylesheet in views/components/head.html:

<link rel="stylesheet" href="/static/css/app.css" />

Load the script at the bottom of views/layouts/index.html, just before the closing </body> tag:

<script type="module" src="/static/js/app.js"></script>

You can now add custom styles and scripts to your application.