Files
cloud-node-container/examples/simple-website/server.js
jknapp aeb934d93e
Some checks failed
Cloud Node Container / Build-and-Push (18) (push) Successful in 1m47s
Cloud Node Container / Build-and-Push (20) (push) Successful in 1m51s
Cloud Node Container / Build-and-Push (22) (push) Has been cancelled
Document PM2 configuration and remove unnecessary ready signal
- Added PM2 configuration notes to README
- Documented that wait_ready is false by default (no signals needed)
- Provided advanced usage instructions for users who need wait_ready
- Removed unnecessary process.send('ready') from simple-website example

This ensures users understand the default PM2 behavior and know how
to customize it if needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 09:55:54 -07:00

29 lines
751 B
JavaScript

const express = require('express');
const path = require('path');
const app = express();
const port = process.env.PORT || 3000;
// Serve static files from public directory
app.use(express.static('public'));
// Basic routes
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.get('/about', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'about.html'));
});
app.get('/contact', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'contact.html'));
});
// Health check for the container
app.get('/ping', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
app.listen(port, () => {
console.log(`Simple website running on port ${port}`);
});