feat: new API endpoint to check the version number

This commit is contained in:
Ravinou 2023-11-11 11:40:57 +01:00
parent 2b5526ab7c
commit 962ef6f634
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7

View file

@ -0,0 +1,16 @@
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;
}
}
}