ok
This commit is contained in:
parent
1b19e09e14
commit
7e17ab5751
|
|
@ -25,6 +25,7 @@ export type HypeProps = {
|
||||||
prettyHTML?: boolean
|
prettyHTML?: boolean
|
||||||
layout?: boolean
|
layout?: boolean
|
||||||
logging?: boolean
|
logging?: boolean
|
||||||
|
ok?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
type InternalProps = HypeProps & { _isRouter?: boolean }
|
type InternalProps = HypeProps & { _isRouter?: boolean }
|
||||||
|
|
@ -141,6 +142,10 @@ export class Hype<
|
||||||
if (this.routesRegistered) return
|
if (this.routesRegistered) return
|
||||||
this.routesRegistered = true
|
this.routesRegistered = true
|
||||||
|
|
||||||
|
// healthcheck
|
||||||
|
if (this.props.ok)
|
||||||
|
this.get('/ok', c => c.text('ok'))
|
||||||
|
|
||||||
// serve frontend js
|
// serve frontend js
|
||||||
this.use('*', async (c, next) => {
|
this.use('*', async (c, next) => {
|
||||||
await fnStorage.run({ fns: new Map(), counter: 0 }, async () => {
|
await fnStorage.run({ fns: new Map(), counter: 0 }, async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user