Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cokoapps/server
  • jgutix/server
2 results
Show changes
Commits on Source (2)
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.7.0](https://gitlab.coko.foundation/cokoapps/server/compare/v1.6.3...v1.7.0) (2020-12-08)
### Features
* **server:** add env variable that will serve build ([e1bec79](https://gitlab.coko.foundation/cokoapps/server/commit/e1bec79db9c972ac9bd9edf0e9cdc58934603727))
### [1.6.3](https://gitlab.coko.foundation/cokoapps/server/compare/v1.6.2...v1.6.3) (2020-11-23) ### [1.6.3](https://gitlab.coko.foundation/cokoapps/server/compare/v1.6.2...v1.6.3) (2020-11-23)
......
{ {
"name": "@coko/server", "name": "@coko/server",
"version": "1.6.3", "version": "1.7.0",
"description": "A tweaked version of pubsweet-server for use by Coko's projects", "description": "A tweaked version of pubsweet-server for use by Coko's projects",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
......
...@@ -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
......