Skip to content

Commit

Permalink
🧹 chore: something i forgor lmao
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Dec 4, 2024
1 parent a36c1aa commit 0797c3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions example/a.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Elysia, t } from '../src'

new Request('', {
duplex: 'half',
})

const app = new Elysia().get(
'/',
() => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elysia",
"description": "Ergonomic Framework for Human",
"version": "1.2.0-exp.47",
"version": "1.2.0-exp.49",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface ElysiaAdapter {
* Elysia().get('/', 'static')
* ```
*/
createStaticHandler(
createStaticHandler?(
handle: unknown,
hooks: AnyLocalHook,
setHeaders?: Context['set']['headers'],
Expand Down
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,8 @@ export default class Elysia<
const adapter = this['~adapter'].handler

const staticHandler =
typeof handle !== 'function'
typeof handle !== 'function' &&
typeof adapter.createStaticHandler === 'function'
? adapter.createStaticHandler(handle, hooks, this.setHeaders)
: undefined

Expand Down Expand Up @@ -732,7 +733,11 @@ export default class Elysia<
localHook: mergeHook(localHook),
hooks,
validator,
handler: handle,
handler:
typeof handle !== 'function' &&
typeof adapter.createStaticHandler !== 'function'
? () => handle
: handle,
allowMeta,
inference,
asManifest
Expand Down Expand Up @@ -5836,6 +5841,9 @@ export default class Elysia<
return this
}

if (typeof this.server?.reload === 'function')
this.server.reload(this.server || {})

this._handle = composeGeneralHandler(this)

return this
Expand Down

0 comments on commit 0797c3f

Please sign in to comment.