Files
pulse/content/integrations/express.mdx
Usman Baig 066f1288f1 feat: trim integration pages from 75 to 25 + migrate to MDX
- Add dedicatedPage flag to integration registry (25 true, 50 false)
- Delete hardcoded nextjs/react/vue/wordpress route pages (wrong metadata)
- Hub page routes non-dedicated integrations to /integrations/script-tag
- Add 301 redirects for 50 removed slugs → /integrations/script-tag
- Migrate guide content from TSX to MDX (content/integrations/*.mdx)
- Add gray-matter, next-mdx-remote, remark-gfm dependencies
- Add content loader (lib/integration-content.ts) matching ciphera-website pattern
- Add prebuild script for integration guide index generation
- Sitemap reduced from 83 to 35 URLs with real lastmod dates
- Remove seoDescription from registry (now in MDX frontmatter)
2026-03-29 00:28:47 +01:00

62 lines
1.4 KiB
Plaintext

---
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.
<CodeBlock filename="views/layout.ejs">{`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<% if (process.env.NODE_ENV === 'production') { %>
<script
defer
data-domain="your-site.com"
src="https://pulse.ciphera.net/script.js"
></script>
<% } %>
<title><%= title %></title>
</head>
<body>
<%- body %>
</body>
</html>`}</CodeBlock>
## Method 2: Static HTML
If you serve static HTML files via Express, add the script directly.
<CodeBlock filename="public/index.html">{`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script
defer
data-domain="your-site.com"
src="https://pulse.ciphera.net/script.js"
></script>
<title>My Express App</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>`}</CodeBlock>