Comparing version 0.0.5 to 0.0.6
18
api.js
const express = require('express'); | ||
const cors = require('cors'); | ||
const bodyParser = require('body-parser'); | ||
const fs = require('fs'); | ||
@@ -8,2 +9,9 @@ const app = express(); | ||
app.use(bodyParser.json()); | ||
app.locals.getConfig = () => { | ||
let config = {}; | ||
if (fs.existsSync('./webdash.json')) { | ||
config = require('./webdash.json'); | ||
} | ||
return config; | ||
} | ||
@@ -41,3 +49,12 @@ const bowerJson = require('./bower.json'); | ||
app.get('/api/webdash/config', (req, res) => { | ||
let config = {}; | ||
if (fs.existsSync('./webdash.json')){ | ||
config = require('./webdash.json'); | ||
} | ||
res.send({ config }); | ||
}); | ||
app.get('/api/webdash/plugins', (req, res) => { | ||
@@ -50,2 +67,3 @@ const plugins = getPlugins(bowerJson); | ||
app.use(express.static(__dirname + '/build/es6-bundled')); | ||
@@ -52,0 +70,0 @@ |
{ | ||
"name": "webdash", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "scripts": { |
const fs = require('fs'); | ||
const { COPYFILE_EXCL } = fs.constants; | ||
fs.copyFile(`${__dirname}/webdash.json`, 'webdash.json', COPYFILE_EXCL, (err) => { | ||
console.log(`${__dirname }/webdash-config.json`); | ||
fs.copyFile(`${__dirname}/webdash-config.json`, 'webdash.json', COPYFILE_EXCL, (err) => { | ||
if (err){ | ||
@@ -6,0 +7,0 @@ //configuration file already exists, we can safely proceed |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168864
302
33
4