---
title: "Discussion on \"I need to know the flow of this MERN app.\" | Hashnode"
description: "Discussion on \"I need to know the flow of this MERN app.\". I am looking to get to know the flow of a MERN application. I want to know how everything is taking place; who is serving whom. How React and Express are connected to each other? Can anyone explain me like five, what happens, say, a request is made f..."
url: "https://hashnode.com/posts/i-need-to-know-the-flow-of-this-mern-app/5ee32aee304fa1181a7d6bb1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [I need to know the flow of this MERN app.](https://hashnode.com/post/i-need-to-know-the-flow-of-this-mern-app?utm_source=hashnode&utm_medium=feed)

I am looking to get to know the flow of a MERN application. I want to know how everything is taking place; who is serving whom. How React and Express are connected to each other? Can anyone explain me like five, what happens, say, a request is made f...

Jun 12, 2020 · hashnode.com  
Read the article

-   [#mern](https://hashnode.com/tag/mern)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#mongodb](https://hashnode.com/tag/mongodb)
-   [#express](https://hashnode.com/tag/express)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Dave Rodriguez](https://hashnode.com/@dave447)

@dave447

  
[View profile](https://hashnode.com/@dave447)

Learner

## Responses 1

Markdown supported · ⌘↵ to post

[Amit Chambial](https://hashnode.com/@amitchambial)

[Jun 12, 2020](https://hashnode.com/posts/i-need-to-know-the-flow-of-this-mern-app/5ee32aee304fa1181a7d6bb1/comment/5ee39582304fa1181a7d7086)

Here Webpack is used to build react jsx.

## webpack.config.js

-   entryPoint: points to React index.js that resides in client/index.js
-   outputDir : /static/bundle.js( after the build is complete the bundle.js go in this folder

## app.js

`app.use("/api/v1/users", userRouter)`

-   all the /api/v1/users request goes to userRouter

`app.use("/*", indexRouter)`

-   all the / request goes to index.js router which in return route it to index.ejs
-   in index.ejs react js bundle file is included , hence routing for /\* will be handled by react routers
-   in index.ejs the react component will be rendered inside `<div id="root"></div>`

> similar to create-react-app we have `public/index.html` there , here we have `index.ejs`

[Dave Rodriguez](https://hashnode.com/@dave447)

[Jun 12, 2020](https://hashnode.com/posts/i-need-to-know-the-flow-of-this-mern-app/5ee32aee304fa1181a7d6bb1/comment/5ee39582304fa1181a7d7086#reply-5ee3bea298c535462075cfa5)

[Amit Chambial](https://hashnode.com/@amitchambial) Thanks a lot for answering my questions. Can you add in your answer? I have added a couple of questions more in my previous reply.

[Amit Chambial](https://hashnode.com/@amitchambial)

[Jun 12, 2020](https://hashnode.com/posts/i-need-to-know-the-flow-of-this-mern-app/5ee32aee304fa1181a7d6bb1/comment/5ee39582304fa1181a7d7086#reply-5ee3c21398c535462075cfab)

[Dave Rodriguez](https://hashnode.com/@dave447) Check my prev reply

[Dave Rodriguez](https://hashnode.com/@dave447)

[Jun 12, 2020](https://hashnode.com/posts/i-need-to-know-the-flow-of-this-mern-app/5ee32aee304fa1181a7d6bb1/comment/5ee39582304fa1181a7d7086#reply-5ee3c60798c535462075d00e)

Thank you so VERY much. I really appreciate your time and knowledge. Cheers.[Amit Chambial](https://hashnode.com/@amitchambial)
