fix style and dev debug

This commit is contained in:
Raphael 2024-05-04 22:51:19 +02:00
parent 93eb8d129c
commit 3a4f0e8bc2
3 changed files with 7 additions and 7 deletions

View File

@ -235,7 +235,7 @@ export default function startBackendServer(port) {
} }
try { try {
query.d = JSON.parse(query.d) query.d = JSON.parse(query.d);
} catch (e) { } catch (e) {
//Dont do a thing //Dont do a thing
} }

View File

@ -15,12 +15,11 @@ const devServerConfig = {
}, },
}; };
export default function then(port, resolve) { export default function startFrontendDevServer(port, resolve) {
new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => { new WebpackDevServer(webpack(config), devServerConfig).start(port, (err) => {
if (err) { if (err) {
console.log(err); console.log(err);
} }
console.log("Listening on port " + port); console.log("Listening on port " + port);
}); });
resolve(1); resolve(1);

View File

@ -1,5 +1,6 @@
import { getArgs } from "./utils.js"; import { getArgs } from "./utils.js";
import startBackendServer from "./server-backend.js"; import startBackendServer from "./server-backend.js";
import startFrontendDevServer from "./server-frontend-dev.js";
const SERVER_MODES = { const SERVER_MODES = {
PRODUCTION: 1, PRODUCTION: 1,
@ -21,7 +22,7 @@ const server_mode = args.mode === "production" ? SERVER_MODES.PRODUCTION : SERVE
if (server_mode === SERVER_MODES.DEVELOPMENT) { if (server_mode === SERVER_MODES.DEVELOPMENT) {
console.info("Starting server in development mode."); console.info("Starting server in development mode.");
import("./server-frontend-dev.js").then(function () { startFrontendDevServer(8080, function () {
// this time, it's the frontend server that is on port 8080 // this time, it's the frontend server that is on port 8080
// requests for the backend will be proxied to prevent cross origins errors // requests for the backend will be proxied to prevent cross origins errors
startBackendServer(3000); startBackendServer(3000);