import https from 'node:https';
export const httpsAgent = new https.Agent({
keepAlive: true,
maxSockets: 50,
timeout: 30_000
import request from 'supertest';
import { app } from '../server/app';
describe('POST /projects', () => {
it('returns 400 for invalid payload', async () => {
const res = await request(app).post('/projects').send({ name: '' });
import { useEffect } from 'react'
interface KeyboardHandlers {
[key: string]: () => void
}
import { z } from 'zod';
const Env = z.object({
NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
DATABASE_URL: z.string().min(1),
REDIS_URL: z.string().min(1).optional(),
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import rehypeSanitize from 'rehype-sanitize'
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
import { tomorrow } from 'react-syntax-highlighter/dist/esm/styles/prism'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
export type PageInfo = {
endCursor: string | null;
hasNextPage: boolean;
};
export type Page<T> = {
import React, { createContext, useContext, useState, ReactNode } from 'react'
type ToastType = 'success' | 'error' | 'info' | 'warning'
interface Toast {
id: string
import crypto from 'node:crypto';
export function base64url(buf: Buffer) {
return buf.toString('base64').replace(/+/g, '-').replace(///g, '_').replace(/=+$/g, '');
}
import { useEffect, useRef } from 'react';
export function useInfiniteScroll(onLoadMore: () => void, enabled: boolean) {
const ref = useRef<HTMLDivElement | null>(null);
useEffect(() => {
export const openapi = {
openapi: '3.0.3',
info: { title: 'Codesnips API', version: '1.0.0' },
paths: {
'/projects': {
post: {
export const env = {
apiBaseUrl: import.meta.env.VITE_API_BASE_URL as string
};