@avaco/utility-portal-config-module

0.9.3 • Public • Published

@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'

Readme

Keywords

none

Package Sidebar

Install

npm i @avaco/utility-portal-config-module

Weekly Downloads

3

Version

0.9.3

License

MIT

Unpacked Size

2.27 kB

Total Files

4

Last publish

Collaborators

  • davidschonlau
  • avaco.manny
  • juliandik
  • k.wittmann
  • netzfluencer