fix style and dev debug
This commit is contained in:
parent
93eb8d129c
commit
3a4f0e8bc2
@ -208,7 +208,7 @@ export default function startBackendServer(port) {
|
||||
*
|
||||
* @apiSuccess {String} body returns "done" as text
|
||||
* @apiError {Number} 401 Unauthorized
|
||||
*
|
||||
*
|
||||
* @apiExample {curl} Example usage to draw a circle:
|
||||
* curl -i http://[rootUrl]/api/drawToWhiteboard?wid=[MyWhiteboardId]&t=circle&d=[388,201,100]&th=4
|
||||
*/
|
||||
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user