Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alex Quispe
doc-generator
Commits
261176e7
Commit
261176e7
authored
Oct 23, 2018
by
Alex Quispe
Browse files
Se adicionó una opción para configurar la url por defecto del server
parent
8f00d6f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
class/ApidocGenerator.js
View file @
261176e7
...
...
@@ -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
(
'
/
'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment