---
title: "Express"
description: "Serve Pulse analytics from your Express.js app. Middleware or template-based setup."
category: "backend"
brandColor: "#000000"
officialUrl: "https://expressjs.com"
relatedIds: ["flask", "nextjs", "react"]
date: "2026-03-28"
---
Add the Pulse script to your template engine's layout (EJS, Pug, Handlebars) or serve it via static HTML.
---
## Method 1: EJS template
If you use EJS as your template engine, add the script to your layout with a production guard.
{`
<% if (process.env.NODE_ENV === 'production') { %>
<% } %>
<%= title %>
<%- body %>
`}
## Method 2: Static HTML
If you serve static HTML files via Express, add the script directly.
{`
My Express App
Hello World
`}