A REST API for GitHub Copilot tips and best practices, built with Node.js and Express using ES6 modules.
- RESTful API endpoints for Copilot tips
- Get tips by ID, topic, or randomly
- CRUD operations for tips management
- JSON file-based data persistence
- Error handling middleware
- Health check endpoint
- CORS support
- Security headers with Helmet
- ES6 module syntax throughout
- Node.js 18.x or higher
- npm
npm installnpm run devnpm startTests are written using Mocha and Chai with chai-http for HTTP assertions.
npm testRun tests in watch mode:
npm run test:watchnpm run lint| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tips | Get all tips |
| GET | /api/tips/random | Get a random tip |
| GET | /api/tips/:id | Get tip by ID |
| GET | /api/tips/topic/:topic | Get tips by topic |
| POST | /api/tips | Create new tip |
| PUT | /api/tips/:id | Update tip |
| DELETE | /api/tips/:id | Delete tip |
| GET | /health | Health check |
See docs/API.md for full API documentation.
This project includes Thunder Client configuration for VS Code:
- Install the Thunder Client extension (
rangav.vscode-thunder-client) - Open Thunder Client from the sidebar
- Import the collection from
.vscode/thunder-client/thunderCollection.json - Import the environment from
.vscode/thunder-client/thunderEnvironment.json - Select "Local Development" environment
- Run requests against your local server
.
|-- .github/workflows/ # CI/CD configuration
|-- .vscode/ # VS Code settings & Thunder Client configs
|-- data/ # Data storage (tips.json)
|-- docs/ # Documentation
|-- src/
| |-- controllers/ # Request handlers
| |-- middleware/ # Express middleware
| |-- routes/ # Route definitions
| |-- services/ # Business logic
| |-- app.js # Express app setup
| +-- index.js # Entry point
+-- tests/ # Mocha/Chai test files
- Runtime: Node.js 18+
- Framework: Express.js
- Module System: ES6 Modules
- Testing: Mocha + Chai + chai-http
- API Testing: Thunder Client (VS Code extension)
MIT