chore: allow passing listhen options

This commit is contained in:
Pooya Parsa 2021-01-22 21:32:29 +01:00
parent 5248905dd7
commit fff38618fe
2 changed files with 7 additions and 4 deletions

View File

@ -102,9 +102,12 @@ function createNuxt2DevServer (nitroContext: NitroContext) {
const listeners = [] const listeners = []
async function listen (port) { async function listen (port) {
const listener = await server.listen(port) const listener = await server.listen(port, {
showURL: false,
isProd: true
})
listeners.push(listener) listeners.push(listener)
return listeners return listener
} }
async function renderRoute (route = '/', renderContext = {}) { async function renderRoute (route = '/', renderContext = {}) {

View File

@ -78,8 +78,8 @@ export function createDevServer (nitroContext: NitroContext) {
// Listen // Listen
let listeners: Listener[] = [] let listeners: Listener[] = []
const _listen = async (port) => { const _listen = async (port, opts?) => {
const listener = await listen(app, { port, showURL: false, isProd: true }) const listener = await listen(app, { port, ...opts })
listeners.push(listener) listeners.push(listener)
return listener return listener
} }