Commit 261176e7 authored by Alex Quispe's avatar Alex Quispe
Browse files

Se adicionó una opción para configurar la url por defecto del server

parent 8f00d6f5
......@@ -29,6 +29,11 @@ class ApidocGenerator {
'Access-Control-Allow-Headers' : '*'
}))
app.use(express.static(path.resolve(__dirname, `${ApidocGenerator.BUILD_PATH}/public`)))
if (ApidocGenerator.REDIRECT_PATH) {
app.get('/', (req, res, next) => {
res.redirect(ApidocGenerator.REDIRECT_PATH)
})
}
return app.listen(ApidocGenerator.SERVER_PORT, () => {
console.log(`\n Servidor para la documentación activo: http://localhost:${ApidocGenerator.SERVER_PORT}\n`)
})
......@@ -240,9 +245,10 @@ class ApidocGenerator {
}
}
ApidocGenerator.SRC_PATH = path.resolve(process.cwd(), `src`)
ApidocGenerator.BUILD_PATH = path.resolve(process.cwd(), `build`)
ApidocGenerator.API_URL = 'http://localhost:4000'
ApidocGenerator.SRC_PATH = path.resolve(process.cwd(), `src`)
ApidocGenerator.BUILD_PATH = path.resolve(process.cwd(), `build`)
ApidocGenerator.API_URL = 'http://localhost:4000'
ApidocGenerator.REDIRECT_PATH = '/apidoc'
function _toWords (text) {
const split = text.split('/')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment