feat: sample backend package w/ express
This commit is contained in:
parent
100b326baf
commit
6dc71c32cc
9 changed files with 743 additions and 16 deletions
29
apps/vdb-backend/package.json
Normal file
29
apps/vdb-backend/package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
15
apps/vdb-backend/src/index.ts
Normal file
15
apps/vdb-backend/src/index.ts
Normal 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);
|
||||||
|
});
|
||||||
15
apps/vdb-backend/tsconfig.json
Normal file
15
apps/vdb-backend/tsconfig.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "nodenext",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
|
"target": "ES2022",
|
||||||
|
"strict": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"outDir": "dist",
|
||||||
|
"declaration": true,
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
export const SAMPLE = "Hello world from common once again!";
|
export const SAMPLE = "Hello world from common once again! abcdefg";
|
||||||
|
|
|
||||||
|
|
@ -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
675
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue