8.0.0 #3

Merged
wanhose merged 30 commits from v8.0.0 into main 2024-10-15 15:01:19 +00:00
Showing only changes of commit 46aefd4688 - Show all commits

View File

@ -0,0 +1,27 @@
import { FastifyInstance, RouteShorthandOptions } from 'fastify';
import fetch from 'node-fetch';
import environment from 'services/environment';
export default (server: FastifyInstance, _options: RouteShorthandOptions, done: () => void) => {
server.get('/version/', async (_request, reply) => {
try {
const options = { headers: { 'Cache-Control': 'no-cache' } };
const url = `${environment.github.files}/packages/browser-extension/src/manifest.json`;
const { version } = await (await fetch(url, options)).json();
reply.send({
data: {
version,
},
success: true,
});
} catch (error) {
reply.send({
errors: [error.message],
success: false,
});
}
});
done();
};