What is your webserver nginx,apache ..etc ?
For nginx,
you need to find the nginx.conf file.It should be in the
/etc/nginx/nginx.conf
open up with vi or nano
vi /etc/nginx/nginx.conf
find the client_max_body_size 2M
client_max_body_size 2M
you can edit this end done.
M = Megabyte G = Gigabyte
if that doesnt work you need to change php.ini for that to work
This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 32M
The maximum size of an uploaded file.
upload_max_filesize = 2M
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 3M
UPDATED FOR HEROKU
if you are using Express v4+ you can use
app.use(bodyParser({limit: '5mb'}));
but make sure this line is above
app.use(bodyParser.json());
otherwise it will not work