Simple feature flag manager
An excercise to see how a minimally viable version of something like LaunchDarkly could be replicated.
Base URL
https://p0u4a-paladin.vercel.app/api
Endpoint
GET /external/get-flag?pname={projectName}&fname={flagName}
Headers
X-Paladin-Key : <api_key>
Response
Flag = {
name: string,
description: string,
active: boolean,
}
-
Run
pnpm install
-
Create a Vercel Postgres database on Vercel
-
Add the necessary enviornment variables to a
.env
filePOSTGRES_URL
POSTGRES_PRISMA_URL
POSTGRES_URL_NON_POOLING
POSTGRES_USER
POSTGRES_HOST
POSTGRES_PASSWORD
POSTGRES_DATABASE
NEXTAUTH_SECRET
-
Push schema to postgres with
prisma db push
-
Use
pnpm run dev
to start project locally