structure: backend API

This commit is contained in:
Alikia2x 2024-04-04 13:43:00 +08:00
parent b3255de375
commit 8a9ef8fcb4
2 changed files with 16 additions and 0 deletions

13
app/api/ping/route.ts Normal file
View File

@ -0,0 +1,13 @@
import { NEXT_API_VERSION, SPARKHOME_VERSION, CLIENT_VERSION } from "@/lib/version";
export const dynamic = "force-dynamic"; // defaults to auto
export async function GET(request: Request) {
const time = new Date().getTime() / 1000;
const responseString =
`SparkHome ${SPARKHOME_VERSION}
Client ${CLIENT_VERSION}
API ${NEXT_API_VERSION}
ServerTime ${time}
Powered by alikia2x (ω< )`;
return new Response(responseString);
}

3
lib/version.ts Normal file
View File

@ -0,0 +1,3 @@
export const SPARKHOME_VERSION="4.6.2";
export const CLIENT_VERSION="4.6.2";
export const NEXT_API_VERSION="4.6.2";