Adds PUT /mangas/:id/cover (multipart) and DELETE /mangas/:id/cover so covers can be replaced or cleared after creation, and wires a dedicated /manga/[id]/edit SvelteKit route that combines the existing PATCH with the new cover endpoints. Cover PUT cleans up the old blob when the extension changes, swallowing StorageError::NotFound so a manually-gone file doesn't surface as a 404 to the client. Edit link on the manga detail page is gated on session.user, matching the auth posture of the underlying handlers. Also pins the local-dev port story via loadEnv() in vite.config.ts so VITE_PORT / BACKEND_URL from a (gitignored) .env keep the dev URL stable across runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
843 B
TypeScript
27 lines
843 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig, loadEnv } from 'vite';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
// Pull in .env so VITE_PORT / BACKEND_URL pin the dev URL across runs.
|
|
// Empty prefix loads every key, not just VITE_*.
|
|
const env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };
|
|
return {
|
|
plugins: [sveltekit()],
|
|
server: {
|
|
port: Number(env.VITE_PORT ?? 5173),
|
|
strictPort: env.VITE_PORT != null,
|
|
proxy: {
|
|
'/api': {
|
|
target: env.BACKEND_URL ?? 'http://localhost:8080',
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.test.ts'],
|
|
globals: false
|
|
}
|
|
};
|
|
});
|