1 Commits

Author SHA1 Message Date
7a6659c3f7 add information about mockdata in readme
All checks were successful
SimcoDash/simcompanies-dashboard/pipeline/head This commit looks good
2020-05-29 19:44:01 +02:00
2 changed files with 4 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ Access the API and frontend files on [http://localhost:3001](http://localhost:30
Runs the app in the developement mode.<br /> Runs the app in the developement mode.<br />
Access the API and frontend files on [http://localhost:3001](http://localhost:3001) to view it in the browser. Access the API and frontend files on [http://localhost:3001](http://localhost:3001) to view it in the browser.
No database needed. Mock data is used.
You can only login with the credentials "test" "test". You can only login with the credentials "test" "test".
The server reloads on changes you still need to refresh your browserpage yourself. The server reloads on changes you still need to refresh your browserpage yourself.

View File

@@ -33,9 +33,6 @@ var sessionStore = new MySQLStore({
const mockDataDay = require('./mockdata-test/day.json'); const mockDataDay = require('./mockdata-test/day.json');
const mockDataWeek = require('./mockdata-test/week.json'); const mockDataWeek = require('./mockdata-test/week.json');
const mockDataMonth = require('./mockdata-test/month.json'); const mockDataMonth = require('./mockdata-test/month.json');
//const mockAmountDataDay = require('./mockdata-test/amountDay.json');
//const mockAmountDataWeek = require('./mockdata-test/amountWeek.json');
//const mockAmountDataMonth = require('./mockdata-test/amountMonth.json');
var resourceList; var resourceList;
const saltRounds = 13; const saltRounds = 13;
@@ -233,7 +230,7 @@ app.get('/API/amount/day', function (req, res) {
const kind = parseInt(req.query.kind); const kind = parseInt(req.query.kind);
if (Number.isInteger(kind)) { if (Number.isInteger(kind)) {
//Mock Data: //Mock Data:
if (kind === -1 || DEBUG) return res.send(mockAmountDataDay); if (kind === -1 || DEBUG) return res.send(mockDataDay);
if (kind >= 1 && kind <= 113) { if (kind >= 1 && kind <= 113) {
var dayend = new Date().toMysqlFormat(); var dayend = new Date().toMysqlFormat();
@@ -293,7 +290,7 @@ app.get('/API/amount/week', function (req, res) {
const kind = parseInt(req.query.kind); const kind = parseInt(req.query.kind);
if (Number.isInteger(kind)) { if (Number.isInteger(kind)) {
//Mock Data: //Mock Data:
if (kind === -1 || DEBUG) return res.send(mockAmountDataWeek); if (kind === -1 || DEBUG) return res.send(mockDataWeek);
if (kind >= 1 && kind <= 113) { if (kind >= 1 && kind <= 113) {
var day = new Date(); var day = new Date();
@@ -326,7 +323,7 @@ app.get('/API/price/month', function (req, res) {
const kind = parseInt(req.query.kind); const kind = parseInt(req.query.kind);
if (Number.isInteger(kind)) { if (Number.isInteger(kind)) {
//Mock Data: //Mock Data:
if (kind === -1 || DEBUG) return res.send(mockAmountDataMonth); if (kind === -1 || DEBUG) return res.send(mockDataMonth);
if (kind >= 1 && kind <= 113) { if (kind >= 1 && kind <= 113) {
var day = new Date(); var day = new Date();