Merge pull request 'make-testable' (#21) from make-testable into master
Reviewed-by: falk <falk.ba@gmx.de>
This commit was merged in pull request #21.
This commit is contained in:
@@ -34,6 +34,8 @@ app.use(express.static(path.join(__dirname, 'frontend')));
|
|||||||
|
|
||||||
app.use(express.static(`${__dirname}/./frontend`));
|
app.use(express.static(`${__dirname}/./frontend`));
|
||||||
app.all("/*", function (req, res, next) {
|
app.all("/*", function (req, res, next) {
|
||||||
|
if (/^\/simcompanies\/API\/.*/.test(req.url))
|
||||||
|
req.url = req.url.substring(13);
|
||||||
if (!/^\/API\/.*/.test(req.url)) {
|
if (!/^\/API\/.*/.test(req.url)) {
|
||||||
return res.sendFile(path.join(__dirname, 'frontend', 'index.html'));
|
return res.sendFile(path.join(__dirname, 'frontend', 'index.html'));
|
||||||
} else return next();
|
} else return next();
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"description": "The backend for the Sim Companies dashboard providing prices from the database",
|
"description": "The backend for the Sim Companies dashboard providing prices from the database",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodemon index.js",
|
"start": "node index.js",
|
||||||
|
"debug": "nodemon index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "Oliver Boehlk",
|
"author": "Oliver Boehlk",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export default function ResourceChart(props) {
|
|||||||
const [data, setData] = React.useState(null);
|
const [data, setData] = React.useState(null);
|
||||||
let { id } = useParams();
|
let { id } = useParams();
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
console.log(id)
|
|
||||||
let nextData = await fetch(`/simcompanies/API/day?date=${props["day"]}&kind=${id}`);
|
let nextData = await fetch(`/simcompanies/API/day?date=${props["day"]}&kind=${id}`);
|
||||||
nextData = await nextData.json();
|
nextData = await nextData.json();
|
||||||
for (let i = 0; i < nextData.length; i++) {
|
for (let i = 0; i < nextData.length; i++) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default function SelectResource() {
|
|||||||
const [resources, setResources] = React.useState(null);
|
const [resources, setResources] = React.useState(null);
|
||||||
|
|
||||||
const loadResources = async () => {
|
const loadResources = async () => {
|
||||||
var resourceJSON = await fetch("API/resourcelist");
|
var resourceJSON = await fetch("/simcompanies/API/resourcelist");
|
||||||
resourceJSON = await resourceJSON.json();
|
resourceJSON = await resourceJSON.json();
|
||||||
let rArr = [];
|
let rArr = [];
|
||||||
for (let i = 0; i < resourceJSON.length; i++) {
|
for (let i = 0; i < resourceJSON.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user