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.all("/*", function (req, res, next) {
|
||||
if (/^\/simcompanies\/API\/.*/.test(req.url))
|
||||
req.url = req.url.substring(13);
|
||||
if (!/^\/API\/.*/.test(req.url)) {
|
||||
return res.sendFile(path.join(__dirname, 'frontend', 'index.html'));
|
||||
} else return next();
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"description": "The backend for the Sim Companies dashboard providing prices from the database",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "nodemon index.js",
|
||||
"start": "node index.js",
|
||||
"debug": "nodemon index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Oliver Boehlk",
|
||||
@@ -16,4 +17,4 @@
|
||||
"node-fetch": "^2.6.0",
|
||||
"nodemon": "^2.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ export default function ResourceChart(props) {
|
||||
const [data, setData] = React.useState(null);
|
||||
let { id } = useParams();
|
||||
const loadData = async () => {
|
||||
console.log(id)
|
||||
let nextData = await fetch(`/simcompanies/API/day?date=${props["day"]}&kind=${id}`);
|
||||
nextData = await nextData.json();
|
||||
for (let i = 0; i < nextData.length; i++) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function SelectResource() {
|
||||
const [resources, setResources] = React.useState(null);
|
||||
|
||||
const loadResources = async () => {
|
||||
var resourceJSON = await fetch("API/resourcelist");
|
||||
var resourceJSON = await fetch("/simcompanies/API/resourcelist");
|
||||
resourceJSON = await resourceJSON.json();
|
||||
let rArr = [];
|
||||
for (let i = 0; i < resourceJSON.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user