This project is used to generate images to be used in mocks
https://imaginer.ksonit.lt/100/100?scale=2&background=rgb(150,200,255)
npm install
If the scaling behaves poorly, need to compile from source with npm install canvas --build-from-source: Automattic/node-canvas#1506
Start server with npm run dev. Open http://localhost:4321/100/100?scale=2&background=rgb(150,200,255)
tscCompiles the app in preparation of production launchdevStartsts-node-dev, which compiles typescript without generating files, reloads on changes and launchesindex.ts(which is anexpressserver in this case)prodCompiles the app and launches it (fromdist/index.js)
canvasCrux of the app: this is used to draw images using HTML Canvas APIexpressBackend server to easily get access to request information (path, query), have different routes, etc.typescriptHave typests-node-devSince this is a node server and not source code for web app, we don't use a bundler. Therefore we need to compile typescript before runningindex.tson our own. On production this will happen withnpm run tsc, but while developing it is more convenient to have it auto recompile when files have changed