From a5ebe9b5409878cc70653c3d8a553e9f946ab583 Mon Sep 17 00:00:00 2001 From: Thomas Buys Date: Mon, 12 Dec 2016 00:21:51 +0100 Subject: [PATCH] Possible fix for occasional error 413 when saving drawing + Remove some console.logs --- app.js | 2 +- client/app/config/app.templates.js | 8 ++++---- client/app/services/drawing.service.js | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 8da0a07..b950734 100644 --- a/app.js +++ b/app.js @@ -36,7 +36,7 @@ server.listen(8085, () => { // uncomment after placing your favicon in /public //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); -app.use(bodyParser.json()); +app.use(bodyParser.json({limit: '10mb'})); app.use(bodyParser.urlencoded({extended: false})); app.use(cookieParser()); //app.use(express.static(path.join(__dirname, 'public'))); diff --git a/client/app/config/app.templates.js b/client/app/config/app.templates.js index f6b3752..302759a 100644 --- a/client/app/config/app.templates.js +++ b/client/app/config/app.templates.js @@ -1,8 +1,8 @@ -angular.module('templates', []).run(['$templateCache', function($templateCache) {$templateCache.put('components/list-errors.html',''); -$templateCache.put('home/home.html','
\r\n\r\n\t
\r\n\t\t\r\n\t
\r\n\t\r\n\t
\r\n\t\t

Welcome to the home page of this Drawing Application.

\r\n\t\t

This website allows you to draw alone or with other people. You can also name your drawing and save it, it will then display here on the home page.

\r\n\t\t

Below you can see a list of drawings that were already saved by other people.

\r\n\t\t

This website was developed by Thomas Buys.

\r\n\t
\r\n\t\r\n\t
\r\n\t\t
\r\n\t\t\t

Loading images...

\r\n\t\t
\r\n\t
\r\n\r\n
\r\n'); -$templateCache.put('auth/auth.html','
\r\n
\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n

\r\n \r\n Have an account?\r\n \r\n\t\t \r\n Need an account?\r\n \r\n

\r\n\t\t\r\n\t\t

{{$ctrl.errors}}

\r\n\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n
\r\n
'); +angular.module('templates', []).run(['$templateCache', function($templateCache) {$templateCache.put('auth/auth.html','
\r\n
\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n

\r\n \r\n Have an account?\r\n \r\n\t\t \r\n Need an account?\r\n \r\n

\r\n\t\t\r\n\t\t

{{$ctrl.errors}}

\r\n\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t \r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n
\r\n
'); +$templateCache.put('components/list-errors.html',''); $templateCache.put('canvas/canvas.html','\r\n\t\r\n
\r\n\r\n\t
\r\n\t\r\n\t\r\n
\r\n\r\n'); $templateCache.put('layout/app-view.html','
'); $templateCache.put('layout/footer.html',''); $templateCache.put('layout/header.html',''); -$templateCache.put('layout/sidebar.html','');}]); \ No newline at end of file +$templateCache.put('layout/sidebar.html',''); +$templateCache.put('home/home.html','
\r\n\r\n\t
\r\n\t\t\r\n\t
\r\n\t\r\n\t
\r\n\t\t

Welcome to the home page of this Drawing Application.

\r\n\t\t

This website allows you to draw alone or with other people. You can also name your drawing and save it, it will then display here on the home page.

\r\n\t\t

Below you can see a list of drawings that were already saved by other people.

\r\n\t\t

This website was developed by Thomas Buys.

\r\n\t
\r\n\t\r\n\t
\r\n\t\t
\r\n\t\t\t

Loading images...

\r\n\t\t
\r\n\t
\r\n\r\n
\r\n');}]); \ No newline at end of file diff --git a/client/app/services/drawing.service.js b/client/app/services/drawing.service.js index 715a7ac..13615dd 100644 --- a/client/app/services/drawing.service.js +++ b/client/app/services/drawing.service.js @@ -33,9 +33,6 @@ export default class Drawing { }).then( (res) => { return res; - }, - (err) => { - console.log(err); } ); } @@ -47,9 +44,6 @@ export default class Drawing { }).then( (res) => { return res; - }, - (err) => { - console.log(err); } ); }