refactor: Remove /ui path prefix

Removed the /ui basePath from Next.js configuration to serve the app at root path:

- Removed basePath: "/ui" from next.config.ts
- Updated all API route calls from /ui/api/* to /api/*
- App now accessible at root path instead of /ui subdirectory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-05 06:29:58 +01:00
parent c8184b0984
commit fa31df4e02
7 changed files with 16 additions and 17 deletions

View File

@@ -45,7 +45,7 @@ export default function ProjectsPage() {
const { data: projects, isLoading: isProjectsLoading } = useQuery({
queryKey: ["projects"],
queryFn: async (): Promise<ListProjects> => {
const res = await fetch("/ui/api/scrapyd/projects");
const res = await fetch("/api/scrapyd/projects");
if (!res.ok) throw new Error("Failed to fetch projects");
return res.json();
},
@@ -56,7 +56,7 @@ export default function ProjectsPage() {
queryKey: ["versions", selectedProject],
queryFn: async (): Promise<ListVersions> => {
const res = await fetch(
`/ui/api/scrapyd/versions?project=${selectedProject}`
`/api/scrapyd/versions?project=${selectedProject}`
);
if (!res.ok) throw new Error("Failed to fetch versions");
return res.json();
@@ -67,7 +67,7 @@ export default function ProjectsPage() {
// Delete project mutation
const deleteProjectMutation = useMutation({
mutationFn: async (project: string) => {
const res = await fetch("/ui/api/scrapyd/projects", {
const res = await fetch("/api/scrapyd/projects", {
method: "DELETE",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ project }),
@@ -85,7 +85,7 @@ export default function ProjectsPage() {
// Upload version mutation
const uploadVersionMutation = useMutation({
mutationFn: async (formData: FormData) => {
const res = await fetch("/ui/api/scrapyd/versions", {
const res = await fetch("/api/scrapyd/versions", {
method: "POST",
body: formData,
});