- Add @astrojs/node adapter for hybrid SSR mode - Replace console logging with better-sqlite3 database storage - Create data/ directory for consent.db persistence - Full consent API: POST (log), GET (fetch), DELETE (remove) - Admin dashboard at /admin/consent-logs.astro with: - Password auth via sessionStorage - Stats cards (total, analytics accepted, rejected, rate %) - 100 latest logs table - Export to CSV functionality - Delete individual records - New Dockerfile: node:20-alpine + sqlite-libs runtime - Admin password: Coolm@n1234mo Note: Static pages remain prerendered, only API/admin routes are SSR.
36 lines
685 B
JavaScript
36 lines
685 B
JavaScript
// @ts-check
|
|
import { defineConfig } from 'astro/config';
|
|
import tailwind from '@astrojs/tailwind';
|
|
import sitemap from '@astrojs/sitemap';
|
|
import node from '@astrojs/node';
|
|
|
|
export default defineConfig({
|
|
site: 'https://dealplustech.co.th',
|
|
adapter: node({
|
|
mode: 'standalone'
|
|
}),
|
|
integrations: [
|
|
tailwind({
|
|
applyBaseStyles: true,
|
|
}),
|
|
sitemap(),
|
|
],
|
|
output: 'static',
|
|
i18n: {
|
|
defaultLocale: 'th',
|
|
locales: ['th'],
|
|
routing: {
|
|
prefixDefaultLocale: false,
|
|
redirectToDefaultLocale: false,
|
|
},
|
|
},
|
|
compressHTML: true,
|
|
build: {
|
|
inlineStylesheets: 'auto',
|
|
},
|
|
vite: {
|
|
build: {
|
|
cssMinify: true,
|
|
},
|
|
},
|
|
}); |