Back to Templates

Node Functions on EdgeOne Pages - Express

A function request demonstration website based on Next.js + Tailwind CSS, showcasing how to deploy Express applications using Node Functions on EdgeOne Pages.

View Demo
FrameworkNext.js
Use CaseStarter
A function request demonstration website based on Next.js + Tailwind CSS, showcasing how to deploy Express applications using Node Functions on EdgeOne Pages.

Node Functions on EdgeOne Pages - Express

A function request demonstration website based on Next.js + Tailwind CSS, showcasing how to deploy Express applications using Node Functions on EdgeOne Pages.

๐Ÿš€ Features

  • Modern UI Design: Adopts black background with white text theme, using #1c66e5 as accent color
  • Responsive Layout: Supports desktop and mobile devices, providing optimal user experience
  • Real-time API Demo: Integrated Express backend with real-time function call testing
  • Component-based Architecture: Uses shadcn/ui style component system
  • TypeScript Support: Complete type definitions and type safety

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 15 - React full-stack framework
  • React 19 - User interface library
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS 4 - Utility-first CSS framework

UI Components

  • shadcn/ui - High-quality React components
  • Lucide React - Beautiful icon library
  • class-variance-authority - Component style variant management
  • clsx & tailwind-merge - CSS class name merging utilities

Backend

  • Express.js - Node.js web application framework
  • Node Functions - EdgeOne Pages serverless functions

๐Ÿ“ Project Structure

express-template/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                 # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css     # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx      # Root layout
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx        # Main page
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ””โ”€โ”€ ui/            # UI base components
โ”‚   โ”‚       โ”œโ”€โ”€ button.tsx  # Button component
โ”‚   โ”‚       โ””โ”€โ”€ card.tsx    # Card component
โ”‚   โ””โ”€โ”€ lib/               # Utility functions
โ”‚       โ””โ”€โ”€ utils.ts       # Common utilities
โ”œโ”€โ”€ public/                # Static assets
โ”œโ”€โ”€ package.json           # Project configuration
โ””โ”€โ”€ README.md             # Project documentation

๐Ÿš€ Quick Start

Requirements

  • Node.js 18+
  • npm or yarn

Install Dependencies

npm install
# or
yarn install

Development Mode

edgeone pages dev

Visit http://localhost:8088 to view the application.

Build Production Version

edgeone pages build

๐ŸŽฏ Core Features

1. Main Page Display

  • Project title and description
  • One-click deployment and view documentation buttons
  • Express code example showcase

2. API Call Demo

  • Real-time function call testing
  • Loading state display
  • Result display

3. Responsive Design

  • Mobile-friendly layout
  • Adaptive component sizing
  • Touch-friendly interactions

๐Ÿ”ง Configuration

Tailwind CSS Configuration

The project uses Tailwind CSS 4 with custom color variables:

:root {
  --primary: #1c66e5;        /* Primary color */
  --background: #000000;     /* Background color */
  --foreground: #ffffff;     /* Foreground color */
}

Component Styling

Uses class-variance-authority to manage component style variants with multiple preset styles.

๐Ÿ“š Documentation

๐Ÿš€ Deployment Guide

EdgeOne Pages Deployment

  1. Push code to GitHub repository
  2. Create new project in EdgeOne Pages console
  3. Select GitHub repository as source
  4. Configure build command: edgeone pages build
  5. Deploy project

Node Functions Configuration

Create node-functions/ folder in project root and add Express application:

// node-functions/express/[[default]].js
import express from "express";
const app = express();

app.get("/", (req, res) => {
  res.json({ message: "Hello from Express on Node Functions!" });
});

export default app;

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.