nuxt-json-config
v0.0.2
Published
config module for nuxt
Readme
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-configUsage
1- Create config folder and config json file on root dir.
$ mkdir config
$ vi config/default.json2- 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.$configexample:
mounted(){
console.log(this.$config.server.host)
}