Getting started with Node + Express on Glitch

Potch - Apr 1 '20 - - Dev Community

Glitch has a cornucopia of projects you can remix, customize, and make your own. But sometimes you just need a quick mostly-blank slate. That's why we provide three "hello world" apps that are designed to be but mere vessels for your great idea or simple experiment. We want to make sure these projects are up-to-date and reflect the latest best practices, so we periodically give them a fresh coat of paint. Recently I wrote about the changes made to our simple database starter hello-sqlite. Next up was hello-express, which provides a simple Node.js and express app!

We want the hello- apps to strike a balance between simple and instructive- there should be minimal functionality that's easy to build on top of or replace, but enough there that creators newer to the technologies can get a baseline understanding of how they work. As with hello-sqlite, it was again decided to add a little more functionality to hello-express to make it a more "complete" app.

Previously, the app did little more than use Node and Express to serve a static site that was functionally the same as hello-webpage (a basic webpage starter). That didn't really show why one would use a server for the task at all! The sample client-side JS now loads information from the server, demonstrating both how to send JSON from the server as well as the basics of using fetch on the client side to get the data.

The big structural change aside, we also did some other tidying and upkeep:

  • 📦 updated Node to latest Long Term Support release, version 12, as well as updated all dependencies
  • ⚖️ file naming consistency between hello-express and hello-sqlite
  • ✨ shiny modern ES6+ features on both frontend and backend
  • 📝 rewriting the README to explain the new project structure
  • 💆‍♀️ some gentle style massage

So with that, enjoy the new hello-express:

Merry remixing!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .