Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
server
Manage
Activity
Members
Labels
Plan
Issues
25
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cokoapps
server
Commits
e1bec79d
Commit
e1bec79d
authored
4 years ago
by
Yannis Barlas
Browse files
Options
Downloads
Patches
Plain Diff
feat(server): add env variable that will serve build
parent
d920a0b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app.js
+8
-4
8 additions, 4 deletions
src/app.js
with
8 additions
and
4 deletions
src/app.js
+
8
−
4
View file @
e1bec79d
...
@@ -17,7 +17,6 @@ const logger = require('@pubsweet/logger')
...
@@ -17,7 +17,6 @@ const logger = require('@pubsweet/logger')
const
registerComponents
=
require
(
'
pubsweet-server/src/register-components
'
)
const
registerComponents
=
require
(
'
pubsweet-server/src/register-components
'
)
const
api
=
require
(
'
pubsweet-server/src/routes/api
'
)
const
api
=
require
(
'
pubsweet-server/src/routes/api
'
)
const
index
=
require
(
'
pubsweet-server/src/routes/index
'
)
const
configureApp
=
app
=>
{
const
configureApp
=
app
=>
{
const
models
=
require
(
'
@pubsweet/models
'
)
const
models
=
require
(
'
@pubsweet/models
'
)
...
@@ -112,14 +111,19 @@ const configureApp = app => {
...
@@ -112,14 +111,19 @@ const configureApp = app => {
useGraphQLServer
=
false
useGraphQLServer
=
false
}
}
logger
.
info
(
'
useGraphQLServer
'
,
useGraphQLServer
)
if
(
useGraphQLServer
)
{
if
(
useGraphQLServer
)
{
const
gqlApi
=
require
(
'
./graphqlApi
'
)
const
gqlApi
=
require
(
'
./graphqlApi
'
)
gqlApi
(
app
)
// GraphQL API
gqlApi
(
app
)
// GraphQL API
}
}
app
.
use
(
'
/
'
,
index
)
// Serve the index page for front end
if
(
config
.
has
(
'
pubsweet-server.serveClient
'
)
&&
config
.
get
(
'
pubsweet-server.serveClient
'
)
)
{
app
.
get
(
'
*
'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
path
.
join
(
'
.
'
,
'
_build
'
,
'
assets
'
,
'
index.html
'
))
})
}
app
.
use
((
err
,
req
,
res
,
next
)
=>
{
app
.
use
((
err
,
req
,
res
,
next
)
=>
{
// Development error handler, will print stacktrace
// Development error handler, will print stacktrace
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment