koopjs / koop-core

Core library for KoopJS (deprecated)
Other
16 stars 19 forks source link

Add disable cors option to allow overriding #157

Closed mtrcn closed 1 year ago

mtrcn commented 1 year ago

Currently, it is not possible to override CORS option that is set in Koop core (see details; https://github.com/koopjs/koop/issues/354), this small change will allow developers to override CORS options.

Possible scenario; as a developer I want to override 'maxAge' property in CORS module.

const config = require('config')
const cors = require('cors')

const koop = new Koop(config)

koop.server.use(cors({"maxAge": 86400}))
const server = koop.server.listen(config.port, () => koop.log.info(`Koop server listening at ${config.port}`))
mtrcn commented 1 year ago

@rgwozdz added, thanks for the review.

rgwozdz commented 1 year ago

published in 5.1.0