mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 22:13:39 +09:00
- Reorganize v3/ into implementation/ subfolders: - planning/, architecture/, migration/, integration/ - security/, adrs/, research/, swarm-plans/ - Add 15-agent concurrent swarm implementation plans: - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x) - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies - Update .claude/settings.json with proper hooks format - Add bash aliases for claude --dangerously-skip-permissions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
76 lines
1.7 KiB
JavaScript
76 lines
1.7 KiB
JavaScript
const express = require('express');
|
|
const app = express();
|
|
const port = process.env.PORT || 3000;
|
|
|
|
// Middleware
|
|
app.use(express.json());
|
|
app.use(express.urlencoded({ extended: true }));
|
|
|
|
// Health check endpoint
|
|
app.get('/health', (req, res) => {
|
|
res.json({
|
|
status: 'healthy',
|
|
service: 'REST API',
|
|
swarmId: 'swarm_aipkebfuq_nexjqmitd',
|
|
created: new Date().toISOString()
|
|
});
|
|
});
|
|
|
|
// Sample endpoints
|
|
app.get('/api/v1/items', (req, res) => {
|
|
res.json({
|
|
items: [
|
|
{ id: 1, name: 'Item 1', description: 'First item' },
|
|
{ id: 2, name: 'Item 2', description: 'Second item' }
|
|
],
|
|
total: 2
|
|
});
|
|
});
|
|
|
|
app.get('/api/v1/items/:id', (req, res) => {
|
|
const id = parseInt(req.params.id);
|
|
res.json({
|
|
id,
|
|
name: `Item ${id}`,
|
|
description: `Description for item ${id}`
|
|
});
|
|
});
|
|
|
|
app.post('/api/v1/items', (req, res) => {
|
|
const newItem = {
|
|
id: Date.now(),
|
|
...req.body,
|
|
createdAt: new Date().toISOString()
|
|
};
|
|
res.status(201).json(newItem);
|
|
});
|
|
|
|
app.put('/api/v1/items/:id', (req, res) => {
|
|
const id = parseInt(req.params.id);
|
|
const updatedItem = {
|
|
id,
|
|
...req.body,
|
|
updatedAt: new Date().toISOString()
|
|
};
|
|
res.json(updatedItem);
|
|
});
|
|
|
|
app.delete('/api/v1/items/:id', (req, res) => {
|
|
const id = parseInt(req.params.id);
|
|
res.json({ message: `Item ${id} deleted successfully` });
|
|
});
|
|
|
|
// Error handling middleware
|
|
app.use((err, req, res, next) => {
|
|
console.error(err.stack);
|
|
res.status(500).json({ error: 'Internal server error' });
|
|
});
|
|
|
|
// Start server
|
|
app.listen(port, () => {
|
|
console.log(`REST API server running on port ${port}`);
|
|
console.log('Created by Claude Flow Swarm');
|
|
});
|
|
|
|
module.exports = app;
|