> For the complete documentation index, see [llms.txt](https://akhilgangula.gitbook.io/mock-json-response/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akhilgangula.gitbook.io/mock-json-response/directory-structure.md).

# Directory Structure

In the previous chapter, we have discussed that there 2 folders needed for Mock JSON response for a successful startup.

The directory structure of your project should be:

```
backend-mock
|
|- index.js
|- functions
|- data
```

functions folder will store the JS files will have logical statements that would define routing and response of a request.

data folder will contain the json files will be mapped from the response object in the functions folder.

A Complete example:&#x20;

{% code title="functions/shoppingCart.js" %}

```javascript
module.exports = {
    logic: function ({ headers }, { data }) {
        // logic to manipulate data
    },
    request: {
        method: "GET",
        urlPath: "/mock/list"
    },
    response: {
        status: 200,
        bodyFileName: "cart.json"
    }
};
```

{% endcode %}

{% code title="cart.json" %}

```javascript
{
    "items": [
        "Apples",
        "Bread"
    ]
}
```

{% endcode %}

Above example, will send data present in cart.json when GET localhost:3000/mock/list is hit.

A detailed description of the field in request and response are given in upcoming chapters!
