0.0.2 • Published 4 years ago
nuxt-json-config v0.0.2
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)
}