mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-24 06:25:48 +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(cors())
|
||||||
app.use(enforce.HTTPS())
|
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
|
// Use the IP blocker middleware
|
||||||
app.use(createIpWhitelistMiddleware(IPCIDR_LIST()))
|
app.use(createIpWhitelistMiddleware(IPCIDR_LIST()))
|
||||||
|
|
||||||
@ -49,12 +55,6 @@ export const firewall = async () => {
|
|||||||
app.use(createVhostProxyMiddleware(host, target, IS_DEV()))
|
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
|
// Fall-through
|
||||||
const handler = createProxyMiddleware({
|
const handler = createProxyMiddleware({
|
||||||
target: `http://localhost:${DAEMON_PORT()}`,
|
target: `http://localhost:${DAEMON_PORT()}`,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user