who-wuda-thunk
breathe
“You are just as likely to solve a problem
by being unconventional and determined
as by being brilliant”
sir james dyson
who wuda thunk?
unfamilar terrain wicked, but me wickeda dan
after countless (mindless) installations of “node” and enough insight to find node modules 🤝 thor’s hammer jokes relatable, i finally had to understand what [node-modules] are.
🧷 basically, you invoke any of them and boom- your app bags an extra layer of complexity.
🧷 these kind sires for instance 👇
..one episode of over-excitement later
did a bit of snooping on repos owned by internet strangers and this guy 👉 express
won’t stop showing up.
🧷 thankfully, MDN pulled up- rather expressive.
this guy too 👉 app.use()
sort of had me stumbling.
🧷 Express Docs came in handy 👇
🧷 Fell into a rabbit hole about ports.
…aaand thus began me woes
the sdk requires that the HTML FILE
for conversion be stationed in a zip file
.
one question… why? why me?
🧷 well, imagine how elated i was when after hours of brute-applying all shades of solutions, it finally clicked. pardon me for ever speaking so flippantly about node-modules.
fr fr i thought i was done
now, imagine how my face dropped, when i encountered yet another.. woe
the pdf file showed up empty and i had no idea why, until when, ofcourse, i headed right back to the docs 👇
🧷 i was missing some js-code
in the source-html
.
🧷 with the js-code
, star-boi data-to-merge
will show up in the empty fields @ source-html
🧷 i.e populate.
🧷 sample files came in handy 👇
<script src="./json.js"></script>
<script type="text/javascript">
function populate()
{
let document = window.document;
document.getElementById("title").innerHTML = String(window.json.title);
document.getElementById("sub-title").innerHTML = String(window.json.sub_title);
}
</script>
(i still have no idea how this works <script src="./json.js"></script>
)
guess who showed up again? problem
👇
multiple attempts to fetch the pdf via the client but the server just won’t budge
..where did i go wrong?
🧷 all it took was a formal request 👇
🧷 plus these guys to handle …and deliver 👇
🧷 and kaboom! 👇
did i mention?
believe me, i went on another bout of why isn’t it working
🧷 because an unwanted slash made it’s way in ..somehow.. 👇
whew!
now that we’ve made it “work”, let’s put it to work.
thank you for reading 🚀