mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-23 22:15:49 +00:00
enh: hoist firewall _api/health endpoint
This commit is contained in:
parent
a302c9ec86
commit
ba7ed7976d
@ -42,6 +42,12 @@ export const firewall = async () => {
|
||||
app.use(cors())
|
||||
app.use(enforce.HTTPS())
|
||||
|
||||
app.get(`/_api/health`, (req, res, next) => {
|
||||
dbg(`Health check`)
|
||||
res.json({ status: 'ok' })
|
||||
res.end()
|
||||
})
|
||||
|
||||
// Use the IP blocker middleware
|
||||
app.use(createIpWhitelistMiddleware(IPCIDR_LIST()))
|
||||
|
||||
@ -49,12 +55,6 @@ export const firewall = async () => {
|
||||
app.use(createVhostProxyMiddleware(host, target, IS_DEV()))
|
||||
})
|
||||
|
||||
app.get(`/_api/health`, (req, res, next) => {
|
||||
dbg(`Health check`)
|
||||
res.json({ status: 'ok' })
|
||||
res.end()
|
||||
})
|
||||
|
||||
// Fall-through
|
||||
const handler = createProxyMiddleware({
|
||||
target: `http://localhost:${DAEMON_PORT()}`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user