Building routes for our backend application in Express is key to separating the static content that will be served for our Angular application from our API endpoints, which will respond with JSON data. Routes in Express are actually just layers of middleware defined to work on specific routes of our web server.
Working with routes in Express
Getting ready
Let's create a simple status page for our future API to check whether it's working. We will make two different endpoints; one that simply returns the API is running text, and one that will return a JSON representation of our route parameters merged with any query parameters.