f9bb247ff1
- Deleted the following API routes: - `upload-cover` - `truyen/[id]/chapters` - `truyen/[id]/comments` - `truyen/[id]/rate` - `truyen/suggest` - `user/bookmarks` - `user/recommendations` - `user/settings` - Updated `chapter-client.tsx` and `novel-client.tsx` to handle error messages more gracefully. - Adjusted pagination logic in `tim-kiem/page.tsx` to improve user experience. - Added support for additional search parameters in the search functionality. - Introduced API rewrites in `next.config.mjs` to route requests to a reader API.
57 lines
1.4 KiB
JavaScript
57 lines
1.4 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const readerApiOrigin = (process.env.READER_API_ORIGIN || "http://localhost:8000").replace(/\/+$/, "")
|
|
|
|
const nextConfig = {
|
|
output: "standalone",
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
images: {
|
|
unoptimized: true,
|
|
},
|
|
async rewrites() {
|
|
return {
|
|
beforeFiles: [
|
|
{
|
|
source: "/api/genres",
|
|
destination: `${readerApiOrigin}/api/genres`,
|
|
},
|
|
{
|
|
source: "/api/novels/:path*",
|
|
destination: `${readerApiOrigin}/api/novels/:path*`,
|
|
},
|
|
{
|
|
source: "/api/truyen/:path*",
|
|
destination: `${readerApiOrigin}/api/truyen/:path*`,
|
|
},
|
|
{
|
|
source: "/api/chapters/:path*",
|
|
destination: `${readerApiOrigin}/api/chapters/:path*`,
|
|
},
|
|
{
|
|
source: "/api/user/:path*",
|
|
destination: `${readerApiOrigin}/api/user/:path*`,
|
|
},
|
|
{
|
|
source: "/api/auth/mobile-login",
|
|
destination: `${readerApiOrigin}/api/auth/mobile-login`,
|
|
},
|
|
{
|
|
source: "/api/health",
|
|
destination: `${readerApiOrigin}/api/health`,
|
|
},
|
|
{
|
|
source: "/api/mod/:path*",
|
|
destination: `${readerApiOrigin}/api/mod/:path*`,
|
|
},
|
|
{
|
|
source: "/api/dev/:path*",
|
|
destination: `${readerApiOrigin}/api/dev/:path*`,
|
|
},
|
|
],
|
|
}
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|