Home

004

April 16, 2020

Over the past couple of days, I managed to set up an Express app template scaffold on my Node server and start serving up some webpages. The web pages are super simple html with naught but text, but they’re live. One thing I’ve been doing to keep up my daily updates is creating a separate html page for each day’s summary. Which is fine for now, but it’s tedious work to create the file, commit it, push it, connect to my server, merge it to the master branch, and restart the app. And so, I’m prioritizing creating a login and backend to be able to create this content directly on my server.

Now, how do I do that?

From what I understand, I need a database to manage user credentials and content, and so I looked into working with Mongodb, which turned into a major headache. I had installed Mongodb a while ago, and it was currently at version 3.6. I wanted to upgrade it to 4.2, which is the current version. After doing a little research, I decided to remove Mongodb entirely and install a fresh copy of the latest version. Attempting to do so via the command line, however, turned into a nightmare. For whatever reason, Ubuntu running on a digitalocean droplet did not want to accept the public key from Mongodb’s direct repository. I kept getting an error when attempting to update the software list. I ended up downloading the files manually from Mongodb’s site, uploading them to the server, and then installing them locally. The whole thing, troubleshooting and all, took a little over an hour.

What a pain in the ass.

Once that was done, I got distracted with playing with images on my pages. I thought to store my images on a separate volume from the server and reference them via each page, but have yet to figure that out. Overall, I didn’t get nearly as much done as I would have liked, but at least I’m better setup than I was when I started today.

Comments? Follow me on twitter and drop me a line in response to this tweet:

Day 004: I had to manually install @MongoDB 4.2 on my @digitalocean droplet because it wasn’t included in the apt repository, and it wasn’t accepting the pgp key. That pretty much took most of my coding time. At least it’s done: https://t.co/wMJXtsEmXW#nonsensemod365 pic.twitter.com/5QhdEBkgkI

— Joshua Alexander (@nonsensecodes) April 17, 2020