Compare commits

...
3 Commits
5 changed files with 42 additions and 16 deletions
+11 -6
View File
@@ -1,19 +1,24 @@
# For Build # For Build
FROM node:22-slim as builder FROM node:22-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
COPY package-lock.json ./ COPY pnpm-lock.yaml ./
COPY tsconfig.json ./ COPY tsconfig.json ./
RUN npm ci
FROM base AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . . COPY . .
RUN pnpm run build
RUN npm run build
# For Run FROM base
FROM node:22-slim RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
WORKDIR /app WORKDIR /app
+4 -2
View File
@@ -1,12 +1,14 @@
// See https://kit.svelte.dev/docs/types#app // See https://kit.svelte.dev/docs/types#app
// for information about these interfaces // for information about these interfaces
import { Database } from 'pg'; import { Pool } from "pg";
import type { SimpleGit } from "simple-git";
declare global { declare global {
namespace App { namespace App {
// interface Error {} // interface Error {}
interface Locals { interface Locals {
db: any; db: Pool;
git: SimpleGit;
} }
// interface PageData {} // interface PageData {}
// interface PageState {} // interface PageState {}
+5 -3
View File
@@ -7,15 +7,16 @@
color: var(--color-text); color: var(--color-text);
padding-left: 2rem; padding-left: 0rem;
box-sizing: border-box; box-sizing: border-box;
h1 { h1 {
position: relative; position: relative;
width: auto; width: auto;
font-size: 1.8rem; font-size: 1.8rem;
margin-bottom: 0.5rem; padding: 1.5rem 0 0.25rem 0;
margin-left: -1rem; margin: 0 0 0.75rem 0rem;
border-bottom: 1px solid var(--color-outline);
} }
hr { hr {
@@ -27,6 +28,7 @@
} }
h2 { h2 {
padding: 1rem 0 0.25rem 0;
font-size: 1.5rem; font-size: 1.5rem;
position: relative; position: relative;
+3 -4
View File
@@ -121,9 +121,8 @@
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;
min-height: 100%; min-height: 100%;
padding: 20px; padding: 100px 100px 0 100px;
padding-top: 100px; max-width: 900px;
max-width: 800px;
margin: 0; margin: 0;
} }
} }
@@ -149,7 +148,7 @@
h1 { h1 {
font-size: 2rem; font-size: 2rem;
text-align: center; text-align: center;
margin: 0; margin: 0 -30px 0 -30px;
padding: 12px; padding: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.3);
box-sizing: border-box; box-sizing: border-box;
+18
View File
@@ -0,0 +1,18 @@
import { json } from '@sveltejs/kit';
import { error } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = async ({ url, locals }) => {
const category = String(url.searchParams.get('category'));
if (!category) {
error(400, 'Bad request');
}
const db = await locals.db;
const article = await db.query(
'SELECT * FROM article WHERE category = $1',
[category]
);
return new Response();
};