feat: Implement automatisch version API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-12 18:54:24 +01:00
parent 7b6e4aa153
commit c81531cb7a
4 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import appConfig from '../../../../config/app';
export default async (request, response) => {
response.json({ version: appConfig.version });
};

View File

@@ -0,0 +1,14 @@
import { describe, it, expect } from 'vitest';
import request from 'supertest';
import app from '../../../../app.js';
import appConfig from '../../../../config/app.js';
describe('GET /api/v1/automatisch/version', () => {
it('should return Automatisch version', async () => {
const response = await request(app)
.get('/api/v1/automatisch/version')
.expect(200);
expect(response.body).toEqual({ version: appConfig.version });
});
});