



I imagine the app will ask the user for the name, and there will be a “Create trip” button. Let’s now dissect this into details, and translate it into a series of API endpoints.Īn endpoint is a unique URL we will call to create an operation.Īt the beginning, there is no trip stored, and we need to add one. We’re not going to create the frontend of the application here, just the API.

When the trip ends, you archive it and it becomes part of the history - which you can navigate and see how much you spent in the past trips. Gasoline, hotels, food, tickets and so on. Imagine going on a trip, and you have your app (which can be a progressive web app, or a mobile app for example) where you add any expense you make. Our task is to create a trip cost calculator app. Tip: make sure you installed a MongoDB database on your system before going on with the tutorial (or use a cloud MongoDB database if you prefer) We’ll use a MongoDB database to store this data. This API will expose a set of GET and POST endpoints to allow getting data out, and sending data in. In this tutorial we’ll create a REST API using Node.js and Express.
