Skip to content

Commit

Permalink
Fix acme route location for manual acme
Browse files Browse the repository at this point in the history
This now catches acme challenge routes BEFORE any route defined by the app router.
  • Loading branch information
gilbert committed Oct 9, 2024
1 parent ec961db commit 138806e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/start/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ let sslListener
const { server, mount, src, modified } = await resolve(config.entry)
const router = Server()

config.acme.domains.length && router.route(Acme.route(isMainThread ? {} : { get: getFromParent }))
if (config.acme.domains.length || config.ssl.mode === 'manual')
router.route(Acme.route(isMainThread ? {} : { get: getFromParent }))

if (server) {
server.esbuild && (await import('../../build/index.js')).default(server.esbuild)
Expand Down Expand Up @@ -65,7 +66,6 @@ async function listenHttp() {
await redirect.listen(config.httpPort, config.address)
console.log('HTTP Redirecting to HTTPS on', config.httpPort) // eslint-disable-line
} else if (config.secure && config.ssl.mode === 'manual') {
router.route(Acme.route(isMainThread ? {} : { get: getFromParent }))
await router.listen(config.httpPort, config.address)
console.log('HTTP (manual ssl) listening on', config.httpPort) // eslint-disable-line
} else {
Expand Down

0 comments on commit 138806e

Please sign in to comment.