Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4b9f2d6
Jag ser att du har lagt till de nödvändiga filerna. Här är en commit-…
irony Aug 13, 2025
5a60b7e
feat: konfigurera server-side rendering för React-applikation
irony Aug 13, 2025
6f5bb83
chore: lägg till express och dess typdefinitioner i beroenden
irony Aug 13, 2025
3c76522
feat: konfigurera server-side rendering (SSR) för Klimatkollen
irony Aug 13, 2025
1258ba4
feat: uppdatera main.tsx för SSR-kompatibilitet
irony Aug 13, 2025
26bbf29
feat: uppdatera routes för att stödja SSR och ta bort språkberoende hook
irony Aug 13, 2025
bc7ae94
feat: generera dataguide JSON och bygg klient- och serversidor
irony Aug 13, 2025
8f74cd7
fix: nedgradera Express till v4.20.0 för kompatibilitet
irony Aug 13, 2025
d5b2684
refactor: förenkla server-konfiguration och övergå till Node.js HTTP-…
irony Aug 13, 2025
927b7f8
fix: uppdatera route för att vara kompatibel med path-to-regexp v8.0.0
irony Aug 13, 2025
9674c47
refactor: uppdatera wildcard-syntax för routes med namngivna parametrar
irony Aug 13, 2025
2512d6e
fix: åtgärda localStorage-problem under server-side rendering
irony Aug 13, 2025
488ea39
fix: importera index.css för att förhindra vit flash under SSR
irony Aug 13, 2025
160938e
fix: injicera Helmet-data korrekt under SSR för att eliminera flash
irony Aug 13, 2025
f74b757
fix: åtgärda hydration mismatch i GlobalSearch-komponenten
irony Aug 13, 2025
86fa876
feat: åtgärda hydration mismatch i Footer-komponenten
irony Aug 13, 2025
82f42e9
feat: lägg till direkt CSS-länk för att förhindra vita flash-effekter
irony Aug 13, 2025
02d94df
perf: lägg till preload för DM Sans-fonter för att minska text-flashing
irony Aug 13, 2025
82fd4b9
perf: lägg till font-display swap för bättre webbplatsprestandaoptime…
irony Aug 13, 2025
0ad866b
feat: ta bort felaktiga font preload-länk
irony Aug 13, 2025
74792da
feat: lägg till språkomdirigering för insights-sidor utan språkprefix
irony Aug 13, 2025
053d485
refactor: förbättra SSR-rendering och hydreringshantering
irony Aug 13, 2025
30bcc3e
refactor: konfigurera om Docker och Kubernetes för SSR med Node.js
irony Aug 13, 2025
abe5f8e
feat: lägg till stöd för statiska filer i public-mappen under bygget
irony Aug 13, 2025
d8125df
feat: implementera lazy loading för optimerad webbplatsprestanda
irony Aug 13, 2025
f13d84e
Baserat på ändringarna föreslår jag följande commit-meddelande:
irony Aug 13, 2025
c6d7349
fix: remove nginx
irony Aug 13, 2025
8139296
Baserat på ändringarna föreslår jag följande commit-meddelande:
irony Aug 13, 2025
3693e0f
feat: lägg till SEO-metadata och strukturerad data för blogginlägg
irony Aug 13, 2025
b9a18ad
fix: förbättra hantering av canonical URL för språkversioner
irony Aug 13, 2025
e163297
feat: lägg till SEO-optimerade URL:er för metodsidor
irony Aug 13, 2025
50304b5
fix: ta bort felaktig URL-navigering i metodologi-meny
irony Aug 13, 2025
4884854
Merge branch 'main' into feat/vite-ssr
irony Aug 27, 2025
877105d
Update server.js
irony Aug 27, 2025
8b641d1
Update src/components/PageSEO.tsx
irony Aug 27, 2025
468b002
Update src/routes.tsx
irony Aug 27, 2025
0988044
Update src/components/PageSEO.tsx
irony Aug 27, 2025
279e9bc
Update vite.config.ts
irony Aug 27, 2025
1af0947
replace old PageSEO with new PageSEO component for all pages and expa…
kaylawoodbury Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,26 @@ COPY . .
RUN npm run build

# Production stage
FROM nginx:alpine
FROM node:20-slim

# Copy built assets from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Set working directory
WORKDIR /app

# Copy package files and install production dependencies
COPY package*.json ./
RUN npm ci --only=production

# Copy built assets and server files from build stage
COPY --from=build /app/dist ./dist
COPY --from=build /app/server.js ./
COPY --from=build /app/index.html ./
COPY --from=build /app/public ./public

# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Set production environment
ENV NODE_ENV=production

# Expose port 80
EXPOSE 80
# Expose port 5173 (or whatever port your server uses)
EXPOSE 5173

# Start nginx
CMD ["nginx", "-g", "daemon off;"]
# Start the Node.js server
CMD ["node", "server.js"]
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
<link rel="alternate" hreflang="sv" href="https://klimatkollen.se" />
<link rel="alternate" hreflang="en" href="https://klimatkollen.se/en" />
<link rel="alternate" hreflang="x-default" href="https://klimatkollen.se" />
<link rel="stylesheet" href="/src/index.css" />
<script defer data-domain="klimatkollen.se" src="https://plausible.io/js/script.js"></script>
<meta http-equiv="content-language" content="sv" />
<title>Klimatkollen - Följ klimatomställningen i Sverige</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<div id="root"><!--ssr-outlet--></div>
<script type="module" src="/src/entry-client.tsx"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
image: ghcr.io/klimatbyran/frontend
imagePullPolicy: Always
ports:
- containerPort: 80
- containerPort: 5173
name: http
resources:
requests:
Expand All @@ -36,13 +36,13 @@ spec:
livenessProbe:
httpGet:
path: /
port: 80
port: 5173
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /
port: 80
port: 5173
initialDelaySeconds: 5
periodSeconds: 10
env:
Expand Down
4 changes: 2 additions & 2 deletions k8s/base/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
targetPort: 5173
protocol: TCP
name: http
selector:
app: frontend
app: frontend
139 changes: 0 additions & 139 deletions nginx.conf

This file was deleted.

Loading