1

I made a notes app and I'm able to submit notes and have a post request send off the data to my mysql database. Everything works great as long as my post is not larger than 64kb.

I'd like to get my posts to be able to get past 64kb. Every time I make a post too large, I get a "413 Payload Too Large" error. I'm using axios, express, nginx, etc. My code for my notes app can be found at https://github.com/ericx2x/notes

Notably, I'm doing something on this line that I believe is causing an issue: https://github.com/ericx2x/notes/blob/master/routes/notes.js#L96

I'm not sure how I troubleshoot this issue as the only real error I receive is in my HTML Headers and I don't know how I can go about pinpointing a 413 error or what to specifically look into..

Eric Lima
  • 102
  • 1
  • 11
  • 1
    Been there, this helped [Error: request entity too large](https://stackoverflow.com/questions/19917401/error-request-entity-too-large) – Lawrence Cherone Feb 26 '19 at 20:44
  • Yes, it sounds like everyone had solved their problem like that but when I tried it doesn't work. Perhaps I'm not doing it correctly? I'm using router which it seems like most people are not? You can view it in my code https://github.com/ericx2x/notes/blob/master/routes/notes.js#L12 @LawrenceCherone – Eric Lima Feb 26 '19 at 20:49
  • 1
    define your middlewares and options before the routing definitions https://github.com/ericx2x/notes/blob/master/app.js#L27 – Lawrence Cherone Feb 26 '19 at 20:54
  • You solved my issue! Thank you very much kind sir. :) @LawrenceCherone – Eric Lima Feb 26 '19 at 21:07

1 Answers1

0

I had to define middlewares and options before the routing definitions

Eric Lima
  • 102
  • 1
  • 11