mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
feat: auth pkg and file proxy scaffold
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
34
apps/file-proxy/.gitignore
vendored
Normal file
34
apps/file-proxy/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# dependencies (bun install)
|
||||
node_modules
|
||||
|
||||
# output
|
||||
out
|
||||
dist
|
||||
*.tgz
|
||||
|
||||
# code coverage
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# logs
|
||||
logs
|
||||
_.log
|
||||
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# caches
|
||||
.eslintcache
|
||||
.cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# IntelliJ based IDEs
|
||||
.idea
|
||||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
15
apps/file-proxy/README.md
Normal file
15
apps/file-proxy/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# drive-file-proxy
|
||||
|
||||
To install dependencies:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
To run:
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.3.0. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
||||
0
apps/file-proxy/convex.ts
Normal file
0
apps/file-proxy/convex.ts
Normal file
12
apps/file-proxy/files.ts
Normal file
12
apps/file-proxy/files.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Hono } from "hono"
|
||||
|
||||
const h = new Hono().basePath("/files")
|
||||
|
||||
h.get("/:fileId", async (c) => {
|
||||
const fileId = c.req.param("fileId")
|
||||
if (!fileId) {
|
||||
return c.json({ error: "File ID is required" }, 400)
|
||||
}
|
||||
})
|
||||
|
||||
export { h as files }
|
||||
10
apps/file-proxy/index.ts
Normal file
10
apps/file-proxy/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Hono } from "hono"
|
||||
import { handleFileRequest } from "./files"
|
||||
|
||||
Bun.serve({
|
||||
routes: {
|
||||
"/files/:fileId": {
|
||||
GET: handleFileRequest,
|
||||
},
|
||||
},
|
||||
})
|
||||
17
apps/file-proxy/package.json
Normal file
17
apps/file-proxy/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@drexa/file-proxy",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fileone/convex": "workspace:*",
|
||||
"convex": "^1.28.0",
|
||||
"hono": "^4.10.1"
|
||||
}
|
||||
}
|
||||
7
apps/file-proxy/router.ts
Normal file
7
apps/file-proxy/router.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { RouterTypes } from "bun"
|
||||
|
||||
function router<
|
||||
R extends { [K in keyof R]: RouterTypes.RouteValue<Extract<K, string>> },
|
||||
>(routes: R): R {
|
||||
return routes
|
||||
}
|
||||
29
apps/file-proxy/tsconfig.json
Normal file
29
apps/file-proxy/tsconfig.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
// Environment setup & latest features
|
||||
"lib": ["ESNext"],
|
||||
"target": "ESNext",
|
||||
"module": "Preserve",
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noImplicitOverride": true,
|
||||
|
||||
// Some stricter flags (disabled by default)
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user