make all test work again locally
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();
|
||||
|
||||
@@ -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