Introduction

Views and Templates

AdonisJS is an excellent fit for creating traditional server-rendered applications in Node.js. If you enjoy the simplicity of using a backend template engine that outputs HTML without any overhead of Virtual DOM and build tools, then this guide is for you.

The typical workflow of a server-rendered application in AdonisJS looks as follows.

  • Choose a template engine to render HTML dynamically.
  • Use Vite for bundling CSS and frontend JavaScript.
  • Optionally, you can opt for libraries like HTMX or Unpoly to progressively enhance your application and navigate like an SPA.

The AdonisJS core team has created a framework-agnostic template engine called Edge.js but does not force you to use it. You can use any other template engine you would like inside an AdonisJS application.

Following is the list of popular template engines you can use inside an AdonisJS application (just like any other Node.js application).

  • EdgeJS is a simple, modern, and batteries included template engine created and maintained by the AdonisJS core team for Node.js.
  • Pug is a template engine heavily influenced by Haml.
  • Nunjucks is a rich feature template engine inspired by Jinja2.

On this page