mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-05 20:17:42 +00:00
chs: re-add drifted files
dot_agents/dot_skill-lock.json
This commit is contained in:
1 parent
03ef5c94ea
commit
42d17e825e
30 files changed
+230
-145
No files matched your search
@@ -65,8 +65,9 @@ let router = createRouter({ middleware })
|
||||
|
||||
### Static files vs browser modules
|
||||
|
||||
- Use `staticFiles()` for files that should be served directly from disk, such as images, fonts, or already-built assets in `public/`
|
||||
- Use `staticFiles()` for files that should be served directly from disk, such as images, fonts, or already-built assets in the root `public/` directory
|
||||
- Use `remix/assets` when browser modules should be compiled and served from source files with import rewriting, preloads, or fingerprinted URLs
|
||||
- `public/` directories inside `app/` hold browser-reachable source for the asset server
|
||||
|
||||
### Ordering notes
|
||||
|
||||
@@ -118,11 +119,11 @@ Use `context.set(key, value)` to add typed values accessible downstream via `con
|
||||
|
||||
```typescript
|
||||
import type { Middleware } from 'remix/router'
|
||||
import { Database } from 'remix/data-table'
|
||||
import { databaseContext } from '~/middleware/database.ts'
|
||||
|
||||
export function loadDatabase(): Middleware {
|
||||
return async (context, next) => {
|
||||
context.set(Database, db)
|
||||
context.set(databaseContext, db)
|
||||
return next()
|
||||
}
|
||||
}
|
||||
@@ -152,11 +153,11 @@ export function requireAdmin(): Middleware {
|
||||
// app/utils/context.ts
|
||||
import { getContext } from 'remix/middleware/async-context'
|
||||
import { Auth } from 'remix/middleware/auth'
|
||||
import { Database } from 'remix/data-table'
|
||||
import { databaseContext } from '~/middleware/database.ts'
|
||||
import { Session } from 'remix/session'
|
||||
|
||||
export function getCurrentDb() {
|
||||
return getContext().get(Database)
|
||||
return getContext().get(databaseContext)
|
||||
}
|
||||
|
||||
export function getCurrentSession() {
|
||||
|
||||
Reference in new issue
Block a user