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
.envfilePOSTGRES_URLPOSTGRES_PRISMA_URLPOSTGRES_URL_NON_POOLINGPOSTGRES_USERPOSTGRES_HOSTPOSTGRES_PASSWORDPOSTGRES_DATABASENEXTAUTH_SECRET
-
Push schema to postgres with
prisma db push -
Use
pnpm run devto start project locally