Friday, 15 May, 2020 UTC


Summary

In this lesson we'll build a basic web server in 2 minutes using Express 5 and node 14's native ES module support. We'll start by creating a new project using `npm init` and then add `"type": "module"` to our package.json file to opt-in to ES Module support. From there we'll create an index.js file where we create an instance of the express module and add a single `GET` route that sends the response `"hello"`. Finally we listen on port 3000 and confirm that our route responds to requests using both curl and a web browser. Pre-requisites: - Install [node 14](http://nodejs.org/) - Make sure you have [curl installed](https://curl.haxx.se/) - Can use a terminal --- **Express 5** Express 5 offers very few changes from version 4. The main one I'm interested in is built-in support for async/await, which greatly simplifies how we handle network and file system I/O calls in our web application. Read more at [Migrating to Express 5](https://expressjs.com/en/guide/migrating-5.html) **async/await** Read more about these recent JavaScript language additions in [Getting Started with async/await](https://www.freecodecamp.org/news/getting-started-with-async-await-b66385983875/) on FreeCodeCamp.