ca-grow-ops-manager/backend/src/routes/cameras.routes.ts
fullsizemalt 57c70b91db
Some checks are pending
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
feat(android): Add Capacitor for Android APK build
- Add Capacitor core, CLI, and Android platform
- Install plugins: camera, push-notifications, splash-screen, status-bar
- Configure capacitor.config.ts with app ID run.runfoo.veridian
- Update vite.config.ts with base: './' for Capacitor compatibility
- Update api.ts and SessionTimeoutWarning.tsx to detect Capacitor and use production API URL
- Generate Android project structure with Gradle build files
2026-01-06 21:56:28 -08:00

30 lines
809 B
TypeScript

import { FastifyInstance } from 'fastify';
import {
getCameras,
getCameraById,
getCameraStream,
createCamera,
updateCamera,
deleteCamera,
updateCameraStatus
} from '../controllers/cameras.controller';
export async function cameraRoutes(server: FastifyInstance) {
// Auth required for all routes
server.addHook('onRequest', async (request) => {
try {
await request.jwtVerify();
} catch (err) {
throw err;
}
});
// CRUD Routes
server.get('/', getCameras);
server.get('/:id', getCameraById);
server.get('/:id/stream', getCameraStream);
server.post('/', createCamera);
server.put('/:id', updateCamera);
server.delete('/:id', deleteCamera);
server.patch('/:id/status', updateCameraStatus);
}