mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-29 01:19:41 +05:00
feat: add changelog modal on visit if new version is detected
This commit is contained in:
parent
04c072fba7
commit
8bcd548ae3
11 changed files with 1137 additions and 22 deletions
17
app/api/version/route.ts
Normal file
17
app/api/version/route.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
|
||||
export async function GET() {
|
||||
const directoryPath = path.join(process.cwd(), "public/changelog");
|
||||
const files = fs.readdirSync(directoryPath);
|
||||
const current = "3.0.1";
|
||||
const previous = [];
|
||||
files.forEach((file) => {
|
||||
if (file != `${current}.md`) {
|
||||
previous.push(file.replace(".md", ""));
|
||||
}
|
||||
});
|
||||
|
||||
return NextResponse.json({ version: current, previous: previous });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue