Change data managment

This commit is contained in:
LordMathis 2017-11-01 18:31:50 +01:00
parent 95dcc7f347
commit bc01f94f6e
3 changed files with 8 additions and 4 deletions

View File

@ -1,11 +1,16 @@
require('babel-register'); require('babel-register');
var app = new (require('express'))() var app = new (require('express'))();
var port = process.env.PORT || 3000; var port = process.env.PORT || 3000;
require('css-modules-require-hook')({ require('css-modules-require-hook')({
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: '[name]__[local]___[hash:base64:5]'
}) });
var fs = require('fs');
var filename = './src/utils/data.json';
var dataStub = {"posts": []};
fs.writeFileSync(filename, JSON.stringify(dataStub));
// initalize webpack dev middleware if in development context // initalize webpack dev middleware if in development context

View File

@ -1 +0,0 @@
{"posts":[]}

View File

@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const async = require('async'); const async = require('async');
const Compiler = require('./compiler'); const Compiler = require('./compiler');
const config = require('../utils/config.json'); const config = require('./config.json');
const data = require('./data.json'); const data = require('./data.json');
module.exports = function() { module.exports = function() {