- index.ts: mount /api/auth, /api/videos, /api/playlists; add cookie-parser; CORS with credentials + FRONTEND_URL env - auth.middleware: read token from Bearer header OR od_token httpOnly cookie - routes: auth (session/logout/me), videos (level-gated), playlists (CRUD + share management) - deps: cookie-parser + @types/cookie-parser
37 lines
1.0 KiB
JSON
37 lines
1.0 KiB
JSON
{
|
|
"name": "originsdigital-backend",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "ts-node-dev --respawn --transpile-only src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"typeorm": "ts-node -e \"require('typeorm/cli')\"",
|
|
"migration:generate": "npm run typeorm -- migration:generate",
|
|
"migration:run": "npm run typeorm -- migration:run",
|
|
"migration:revert": "npm run typeorm -- migration:revert"
|
|
},
|
|
"dependencies": {
|
|
"bcrypt": "^5.1.1",
|
|
"cookie-parser": "^1.4.7",
|
|
"cors": "^2.8.5",
|
|
"dotenv": "^16.4.5",
|
|
"express": "^4.18.3",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"mysql2": "^3.9.3",
|
|
"reflect-metadata": "^0.2.2",
|
|
"typeorm": "^0.3.20"
|
|
},
|
|
"devDependencies": {
|
|
"@types/bcrypt": "^5.0.2",
|
|
"@types/cookie-parser": "^1.4.10",
|
|
"@types/cors": "^2.8.17",
|
|
"@types/express": "^4.17.21",
|
|
"@types/jsonwebtoken": "^9.0.6",
|
|
"@types/node": "^20.12.2",
|
|
"ts-node": "^10.9.2",
|
|
"ts-node-dev": "^2.0.0",
|
|
"typescript": "^5.4.3"
|
|
}
|
|
}
|