0.0.2 • Published 4 years ago

nuxt-json-config v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

JSON CONFIG FOR NUXT

This module allows you to have Node config package into nuxtjs.

Installation

Use the package manager pip to install foobar.

npm i nuxt-json-config

Usage

1- Create config folder and config json file on root dir.

$ mkdir config
$ vi config/default.json

2- Edit config as you wish

{
  "server":{
    "host":"http://localhost:3000",
    "example":"/api/ex"
 }
}

3- Register module in nuxt.config.js

  modules: [
    'nuxt-json-config'
  ],

4- yarn dev and start the project

in components, you can access all config by

this.$config

example:

mounted(){
  console.log(this.$config.server.host)
}

License

MIT