0.9.3 • Published 2 years ago

@avaco/utility-portal-config-module v0.9.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@avaco/utility-portal-config-module

This creates a configuration object that is using default values which can be changed on runtime.

Example Usage

Setup

// @/config/index.js
import { PortalConfigModule } from '@avaco/utility-portal-config-module'
import defaultConfig from './defaultConfig'

const portalConfigModule = new PortalConfigModule({
  moduleName: 'fragment-foo',
  defaultConfig
}).withTypes()

export default portalConfigModule
// @/config/defaultConfig.js
export default {
  urls: {
    backendUrl: 'https://backend-portal-master.my-portal.io'
  },
  filePath: 'portal-fileservice/api/v1/file'
}

Usage

import portalConfig from '@/config'

console.log(portalConfig.urls.backendUrl) // 'https://backend-portal-master.my-portal.io'
console.log(portalConfig.filePath) // 'portal-fileservice/api/v1/file'