feat: sample backend package w/ express

This commit is contained in:
Benjamin Singleton 2025-06-10 17:11:14 -05:00
parent 100b326baf
commit 6dc71c32cc
9 changed files with 743 additions and 16 deletions

View file

@ -0,0 +1,29 @@
{
"name": "@repo/vdb-backend",
"version": "1.0.0",
"description": "",
"type": "module",
"exports": {
"./*": {
"types": "./dist/*.d.ts",
"import": "./dist/*.js"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "pnpm exec tsc",
"start": "pnpm exec tsx src/index"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.11.0",
"dependencies": {
"@repo/common": "workspace:*",
"express": "^5.1.0"
},
"devDependencies": {
"@types/express": "^5.0.3",
"tsx": "^4.19.4"
}
}

View file

@ -0,0 +1,15 @@
import { SAMPLE } from "@repo/common/sample";
import express from "express";
const PORT = 1224;
const app = express();
app.get("/sample", (_req, res) => {
res.status(200).send(SAMPLE);
});
app.listen(PORT, () => {
console.log(`Backend started @ http://localhost:${PORT} !`);
console.log(SAMPLE);
});

View file

@ -0,0 +1,15 @@
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "ES2022",
"strict": true,
"noUncheckedIndexedAccess": true,
"sourceMap": true,
"outDir": "dist",
"declaration": true,
},
"include": [
"src"
]
}

View file

@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "turbo dev --filter=^... & vite",
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},

View file

@ -5,17 +5,20 @@
"type": "module",
"exports": {
"./*": {
"types": "./dist/*.d.ts",
"types": "./src/*.ts",
"import": "./dist/*.js"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "pnpm exec tsc",
"dev": "pnpm exec tsc --watch"
"build": "rm -rf ./dist & pnpm exec tsc",
"watch": "rm -rf ./dist & pnpm exec tsc --watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.11.0"
"packageManager": "pnpm@10.11.0",
"devDependencies": {
"typescript": "~5.8.3"
}
}

View file

@ -1 +1 @@
export const SAMPLE = "Hello world from common once again!";
export const SAMPLE = "Hello world from common once again! abcdefg";

View file

@ -7,7 +7,6 @@
"noUncheckedIndexedAccess": true,
"sourceMap": true,
"outDir": "dist",
"declaration": true,
},
"include": [
"src"

675
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,16 @@
"check-types": {
"dependsOn": ["^check-types"]
},
"watch": {
"dependsOn": ["^watch"]
},
"dev": {
"dependsOn": ["^watch"],
"persistent": true,
"cache": false
},
"start": {
"dependsOn": ["^build"],
"persistent": true,
"cache": false
}