Remember that routing on this framework is all about patterns. Let's keep it simple for now and use a role property to indicate what we want to do (upload, check, or download).
By default, every message should be JSON-encoded, so we'll encode the image in base64 to pass it as a string inside the JSON messages to upload and download.
Create a folder for our Seneca service, and then create a child folder called uploads. Then, install seneca and sharp on that folder by running the following command:
npm install seneca sharp --save
Then, create a file called imagini.js with the following content:
const seneca = require("seneca");const sharp = require("sharp");const path = require("path");const fs = require("fs");const service = seneca(); ...