UPDATE: Change using api to using static file
Gitea Auto Deploy / Deploy-Container (push) Failing after 2m2s
Gitea Auto Deploy / Deploy-Container (push) Failing after 2m2s
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadAS } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const asData = await loadAS([id], locale)
|
||||
const as = asData[id]
|
||||
|
||||
if (!as) {
|
||||
return NextResponse.json({ error: 'AS info not found' }, { status: 404 })
|
||||
}
|
||||
return new NextResponse(JSON.stringify(as), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadAS } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const asIds = body.asIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(asIds) || asIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid asIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const asData = await loadAS(asIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(asData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load as data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadCharacters } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const characters = await loadCharacters([id], locale)
|
||||
const char = characters[id]
|
||||
|
||||
if (!char) {
|
||||
return NextResponse.json({ error: 'Character not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(char), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadCharacters } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const charIds = body.charIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(charIds) || charIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid charIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const characters = await loadCharacters(charIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(characters), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load characters' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadLightcones } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const lightcones = await loadLightcones([id], locale)
|
||||
const lightcone = lightcones[id]
|
||||
|
||||
if (!lightcone) {
|
||||
return NextResponse.json({ error: 'Lightcone not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(lightcone), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadLightcones } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const lightconeIds = body.lightconeIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(lightconeIds) || lightconeIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid lightconeIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const lightcones = await loadLightcones(lightconeIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(lightcones), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load lightcones' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadMOC } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const mocData = await loadMOC([id], locale)
|
||||
const moc = mocData[id]
|
||||
|
||||
if (!moc) {
|
||||
return NextResponse.json({ error: 'MOC info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(moc), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadMOC } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const mocIds = body.mocIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(mocIds) || mocIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid mocIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const mocData = await loadMOC(mocIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(mocData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load moc data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadMonster } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const monsterData = await loadMonster([id], locale)
|
||||
const monster = monsterData[id]
|
||||
|
||||
if (!monster) {
|
||||
return NextResponse.json({ error: 'Monster info not found' }, { status: 404 })
|
||||
}
|
||||
return new NextResponse(JSON.stringify(monster), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadMonster } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const monsterIds = body.monsterIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(monsterIds) || monsterIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid monsterIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const monsterData = await loadMonster(monsterIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(monsterData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load monster data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadPeak } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const peakData = await loadPeak([id], locale)
|
||||
const peak = peakData[id]
|
||||
|
||||
if (!peak) {
|
||||
return NextResponse.json({ error: 'Peak info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(peak), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadPeak } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const peakIds = body.peakIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(peakIds) || peakIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid peakIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const peakData = await loadPeak(peakIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(peakData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load peak data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadPF } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const pfData = await loadPF([id], locale)
|
||||
const pf = pfData[id]
|
||||
|
||||
if (!pf) {
|
||||
return NextResponse.json({ error: 'PF info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
|
||||
return new NextResponse(JSON.stringify(pf), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { loadPF } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const pfIds = body.pfIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(pfIds) || pfIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid pfIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const pfData = await loadPF(pfIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(pfData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load pf data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadRelics } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const relics = await loadRelics([id], locale)
|
||||
const relic = relics[id]
|
||||
|
||||
if (!relic) {
|
||||
return NextResponse.json({ error: 'Relic not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return new NextResponse(JSON.stringify(relic), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { loadRelics } from "@/lib/loader";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const relicIds = body.relicIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(relicIds) || relicIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid relicIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const relics = await loadRelics(relicIds, locale);
|
||||
|
||||
return new NextResponse(JSON.stringify(relics), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load relics' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { loadConfigMaze } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const configMaze = await loadConfigMaze();
|
||||
return new NextResponse(JSON.stringify(configMaze), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load config maze' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { loadMainAffix } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const mainAffix = await loadMainAffix();
|
||||
return new NextResponse(JSON.stringify(mainAffix), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load main affix' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { loadSubAffix } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const subAffix = await loadSubAffix();
|
||||
return new NextResponse(JSON.stringify(subAffix), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load sub affix' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user