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

@ -230,13 +230,13 @@ export default function startBackendServer(port) {
broadcastTo(readOnlyId);
try {
query.th = parseFloat(query.th);
} catch(e) {
} catch (e) {
//Dont do a thing
}
try {
query.d = JSON.parse(query.d)
} catch(e) {
query.d = JSON.parse(query.d);
} catch (e) {
//Dont do a thing
}
s_whiteboard.handleEventsAndData(query); //save whiteboardchanges on the server

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) => {
if (err) {
console.log(err);
}
console.log("Listening on port " + port);
});
resolve(1);

View File

@ -1,5 +1,6 @@
import { getArgs } from "./utils.js";
import startBackendServer from "./server-backend.js";
import startFrontendDevServer from "./server-frontend-dev.js";
const SERVER_MODES = {
PRODUCTION: 1,
@ -21,7 +22,7 @@ const server_mode = args.mode === "production" ? SERVER_MODES.PRODUCTION : SERVE
if (server_mode === SERVER_MODES.DEVELOPMENT) {
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
// requests for the backend will be proxied to prevent cross origins errors
startBackendServer(3000);