feat: sample backend package w/ express

This commit is contained in:
Benjamin Singleton 2025-06-10 17:11:14 -05:00 committed by Sheldon Cooper
parent 63a9019b2a
commit 4ebce1448a
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", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "turbo dev --filter=^... & vite", "dev": "vite",
"build": "vue-tsc -b && vite build", "build": "vue-tsc -b && vite build",
"preview": "vite preview" "preview": "vite preview"
}, },

View file

@ -5,17 +5,20 @@
"type": "module", "type": "module",
"exports": { "exports": {
"./*": { "./*": {
"types": "./dist/*.d.ts", "types": "./src/*.ts",
"import": "./dist/*.js" "import": "./dist/*.js"
} }
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "pnpm exec tsc", "build": "rm -rf ./dist & pnpm exec tsc",
"dev": "pnpm exec tsc --watch" "watch": "rm -rf ./dist & pnpm exec tsc --watch"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "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, "noUncheckedIndexedAccess": true,
"sourceMap": true, "sourceMap": true,
"outDir": "dist", "outDir": "dist",
"declaration": true,
}, },
"include": [ "include": [
"src" "src"

675
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

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