Test deploy #31

Merged
John4064 merged 50 commits from test-deploy into main 2026-03-04 05:20:21 +00:00
Showing only changes of commit bcc9ffff74 - Show all commits

View file

@ -1,6 +1,7 @@
import express from 'express'; import express from 'express';
import cors from 'cors'; import cors from 'cors';
import dotenv from 'dotenv'; import dotenv from 'dotenv';
import fs from 'fs/promises';
import { medicationRouter } from './services/medications/index.js'; import { medicationRouter } from './services/medications/index.js';
import { shiftsRouter } from './services/shifts/index.js'; import { shiftsRouter } from './services/shifts/index.js';
import { shiftRunQuery } from './services/shiftConnection.js'; import { shiftRunQuery } from './services/shiftConnection.js';
@ -45,9 +46,12 @@ app.get('/api/db-health', async (req, res) => {
res.status(500).json({ connected: false, error: err.message }); res.status(500).json({ connected: false, error: err.message });
} }
}); });
app.get('/api/version', async (req, res) => { app.get('/api/version', async (req, res) => {
try { try {
res.json('1.0.9'); const packageData = await fs.readFile('./package.json', 'utf8');
const pkg = JSON.parse(packageData);
res.json(pkg.version);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
res.status(500).json({ connected: false, error: err.message }); res.status(500).json({ connected: false, error: err.message });