Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
blob: f6682a128a64a1e7213544a8fc5da74683dc41a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Install dev server packages

    docker run --rm -w /app -v $PWD:/app -u $(id -u):$(id -u) node npm install

## Start the dev server

    docker run --rm --init -it -w /app -v $PWD:/app -p 8080:8080 node node dev-server.js

Visit `localhost:8080` to view.

## Rough way to save the SVG map generated by JavaScript client-side

    const XMLS = new XMLSerializer();
    const svg_xmls = XMLS.serializeToString(svg);
    let bl = new Blob([svg_xmls], {type: "text/html" });
    let a = document.createElement("a");
    a.href = URL.createObjectURL(bl);
    a.download = "map.svg";
    a.hidden = true;
    document.body.appendChild(a);
    a.innerHTML = "something random - nobody will see this, it doesn't matter what you put here";
    a.click()