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 (3)
......@@ -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.
## [1.6.0](https://gitlab.coko.foundation/cokoapps/server/compare/v1.5.0...v1.6.0) (2020-11-20)
### Features
* **server:** allow server to read broken down client url for cors ([a3997b7](https://gitlab.coko.foundation/cokoapps/server/commit/a3997b770883a53197686e98a6d7b30a21d67100))
## [1.5.0](https://gitlab.coko.foundation/cokoapps/server/compare/v1.4.1...v1.5.0) (2020-11-16)
......
......@@ -189,7 +189,15 @@ If you run your client on a different host/port than the server, you might run i
### Other exports from included packages
##### Logger
##### startServer
Returns function to start pubsweet server. Useful for when you want to avoid using any cli wrapper (eg. for production docker images).
```js
const { startServer } = require('@coko/server')
```
##### logger
Returns pubsweet's logger
......@@ -197,7 +205,7 @@ Returns pubsweet's logger
const { logger } = require('@coko/server')
```
##### Base Model
##### BaseModel
Returns pubsweet's base model
......
{
"name": "@coko/server",
"version": "1.5.0",
"version": "1.6.0",
"description": "A tweaked version of pubsweet-server for use by Coko's projects",
"main": "src/index.js",
"scripts": {
......@@ -23,26 +23,26 @@
"access": "public"
},
"dependencies": {
"@pubsweet/base-model": "^3.6.5",
"@pubsweet/errors": "^2.0.32",
"@pubsweet/logger": "^0.2.42",
"@pubsweet/models": "^0.3.7",
"@pubsweet/base-model": "^4.0.3",
"@pubsweet/errors": "^2.0.39",
"@pubsweet/logger": "^0.2.49",
"@pubsweet/models": "^0.3.14",
"apollo-server-express": "^2.11.0",
"body-parser": "^1.19.0",
"config": "^3.3.1",
"config": "^3.3.2",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"express": "^4.17.1",
"graphql-middleware": "^4.0.2",
"graphql-shield": "^7.2.6",
"helmet": "^3.22.0",
"graphql-shield": "^7.4.1",
"helmet": "^3.22.1",
"http-status-codes": "^1.4.0",
"lodash": "^4.17.15",
"lodash": "^4.17.20",
"morgan": "^1.10.0",
"node-cron": "^2.0.3",
"passport": "^0.4.1",
"pubsweet": "^5.1.10",
"pubsweet-server": "^13.9.4",
"pubsweet": "^5.1.18",
"pubsweet-server": "^13.11.5",
"waait": "^1.0.5"
},
"devDependencies": {
......
......@@ -57,15 +57,18 @@ const configureApp = app => {
}
// Allow CORS from client if host / port is different
if (
config.has('pubsweet-client.host') &&
config.has('pubsweet-client.port')
) {
if (config.has('pubsweet-client.host')) {
const clientProtocol = config.get('pubsweet-client.protocol') || 'http'
const clientHost = config.get('pubsweet-client.host')
const clientPort = config.get('pubsweet-client.port')
const clientUrl = `${clientProtocol}://${clientHost}${
clientPort ? `:${clientPort}` : ''
}`
app.use(
cors({
origin: `${config.get('pubsweet-client.host')}:${config.get(
'pubsweet-client.port',
)}`,
origin: clientUrl,
credentials: true,
}),
)
......
This diff is collapsed.