> Typically when you create a RESTful API you are going to be returning data from a database. For simplicity we are just going simulate this with a simple data array so that we can focus on the Express syntax rather than database handling. Later we will integrate this with a [MongoDB database](/Programming_Languages/NodeJS/REST_APIs/05_%20Integrating_the_database.md).
We first create an instance of Express within `index.js`. This will be the main coordinating file and we will aim to minimise the amount of business logic we have in this file. It should really just be for initialization and managing [middleware](/Programming_Languages/NodeJS/Architecture/Middleware.md).
We are going to receive all our HTTP requests at the path `/api/courses` and we will place all code related to this route in a dedicated Node module (`routes/courses.js`) rather than within `index.js` which should remain as uncluttered as possible.
We target the `Router` instance we created and all paths will be expressed as `/` since the app will route by default to `/courses/api` from `index.js`