borgwarehouse/pages/api/version/index.js
2024-08-31 21:01:01 +02:00

16 lines
383 B
JavaScript

import packageInfo from '../../../package.json';
export default async function handler(req, res) {
if (req.method === 'GET') {
try {
res.status(200).json({ version: packageInfo.version });
return;
} catch (error) {
res.status(500).json({
status: 500,
message: 'API error, contact the administrator !',
});
return;
}
}
}